view tests/Makefile @ 34:c24cbfa44f81

Don't actually include stdio.h in this for testing cpp. (If you do, the test output becomes host-dependent.)
author David A. Holland
date Sat, 30 Mar 2013 20:38:17 -0400
parents 8a955e3dda2c
children b30f69cab9bc
line wrap: on
line source

TRADCPP=../obj/tradcpp  # XXX

TESTS=t01 t02 t03 t04 t05 t06 t07 t08 t09

all: run-tests .WAIT show-diffs

.for T in $(TESTS)
run-tests: $(T).diff

$(T).diff: $(T).run $(T).good $(TRADCPP)
	-diff $(T).good $(T).run > $(T).diff

$(T).run: $(TRADCPP) $(T).c
	$(TRADCPP) $(T).c > $(T).run 2>&1 || echo FAILED >> $(T).run
.endfor

show-diffs:
	@echo '*** Test diffs ***'
.for T in $(TESTS)
	@cat $(T).diff
.endfor

clean:
.for T in $(TESTS)
	rm -f $(T).run $(T).diff
.endfor

good:
.for T in $(TESTS)
	cp $(T).run $(T).good
.endfor

.PHONY: all run-tests show-diffs clean good