summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-02-19 00:01:34 -0500
committerJune McEnroe <june@causal.agency>2022-02-19 00:01:34 -0500
commit06d17aa8f114360f2b5a3e6e1fa011bfc2d806ba (patch)
tree3f870e8e9319d430fa7710721d0722d9c42f7cf9 /Makefile
parentImplement new line editing "library" (diff)
downloadcatgirl-06d17aa8f114360f2b5a3e6e1fa011bfc2d806ba.tar.gz
catgirl-06d17aa8f114360f2b5a3e6e1fa011bfc2d806ba.zip
Run line editing tests
I know, it feels wrong.
Diffstat (limited to '')
-rw-r--r--Makefile16
1 files changed, 13 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 9e6392b..fccee7f 100644
--- a/Makefile
+++ b/Makefile
@@ -25,20 +25,30 @@ OBJS += ui.o
 OBJS += url.o
 OBJS += xdg.o
 
-dev: tags all
+TESTS += edit.t
+
+dev: tags all check
 
 all: catgirl
 
 catgirl: ${OBJS}
 	${CC} ${LDFLAGS} ${OBJS} ${LDLIBS} -o $@
 
-${OBJS}: chat.h edit.h
+${OBJS} ${TESTS}: chat.h edit.h
+
+check: ${TESTS}
+
+.SUFFIXES: .t
+
+.c.t:
+	${CC} ${CFLAGS} -DTEST ${LDFLAGS} $< ${LDLIBS} -o $@
+	./$@ || rm $@
 
 tags: *.[ch]
 	ctags -w *.[ch]
 
 clean:
-	rm -f catgirl ${OBJS} tags
+	rm -f catgirl ${OBJS} ${TESTS} tags
 
 install: catgirl catgirl.1
 	install -d ${DESTDIR}${BINDIR} ${DESTDIR}${MANDIR}/man1