The individual tests in tests2 are checked only with -run. Build (and check) executables as well, to test also building executables.
Unified · Split
| @@ -94,13 +94,18 @@ endif · 93 unmodified lines | |||
| 94 | @if [ "x`echo $* | grep args`" != "x" ]; \ | 94 | @if [ "x`echo $* | grep args`" != "x" ]; \ |
| 95 | then $(TCC) $< -norunsrc -run $(notdir $<) - arg1 arg2 arg3 arg4 >$*.output 2>&1; \ | 95 | then $(TCC) $< -norunsrc -run $(notdir $<) - arg1 arg2 arg3 arg4 >$*.output 2>&1; \ |
| 96 | else $(TCC) -run $< >$*.output 2>&1; \ | 96 | else $(TCC) -run $< >$*.output 2>&1; \ |
| 97 | ($(TCC) -o $*.exe $< -lm && ./$*.exe) >$*.output2 2>&1; \ | ||
| 97 | fi || true | 98 | fi || true |
| 98 | @if diff -bu $(<:.c=.expect) $*.output ; \ | 99 | @if diff -bu $(<:.c=.expect) $*.output ; \ |
| 99 | then rm -f $*.output; \ | 100 | then rm -f $*.output; \ |
| 100 | else exit 1; \ | 101 | else exit 1; \ |
| 101 | fi | 102 | fi |
| 103 | @if test -f $*.output2; then if diff -bu $(<:.c=.expect) $*.output2 ; \ | ||
| 104 | then rm -f $*.output2; \ | ||
| 105 | else exit 1; \ | ||
| 106 | fi; fi | ||
| 102 | 107 | ||
| 103 | all test: $(TESTS) | 108 | all test: $(TESTS) |
| 104 | 109 | ||
| 105 | clean: | 110 | clean: |
| 106 | rm -vf fred.txt *.output | 111 | rm -vf fred.txt *.output* *.exe |