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 | 94 | @if [ "x`echo $* | grep args`" != "x" ]; \ |
| 95 | 95 | then $(TCC) $< -norunsrc -run $(notdir $<) - arg1 arg2 arg3 arg4 >$*.output 2>&1; \ |
| 96 | 96 | else $(TCC) -run $< >$*.output 2>&1; \ |
| 97 | + ($(TCC) -o $*.exe $< -lm && ./$*.exe) >$*.output2 2>&1; \ | |
| 97 | 98 | fi || true |
| 98 | 99 | @if diff -bu $(<:.c=.expect) $*.output ; \ |
| 99 | 100 | then rm -f $*.output; \ |
| 100 | 101 | else exit 1; \ |
| 101 | 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 | 108 | all test: $(TESTS) |
| 104 | 109 | |
| 105 | 110 | clean: |
| 106 | − rm -vf fred.txt *.output | |
| 111 | + rm -vf fred.txt *.output* *.exe | |