picoc/test/Makefile

24 lines
444 B
Makefile
Raw Normal View History

TESTS= 00_assignment.test \
01_comment.test \
02_printf.test \
03_struct.test \
04_for.test \
05_array.test
%.test: %.expect %.c
@echo Test: $*...
-@../picoc $*.c 2>&1 >$*.output
@if [ "x`diff -qu $*.expect $*.output`" != "x" ]; \
then \
echo "error in test $*"; \
diff -u $*.expect $*.output; \
rm -f $*.output; \
exit 1; \
fi; \
rm -f $*.output
all: test
test: $(TESTS)
@echo "test passed"