tests.mk (345B)
1 awk_query = $$(awk '/\/\* $1/{flag=1; next}/$1 \*\//{flag=0}flag' $2.c) 2 test_cmd = if [ "$$($< $(call awk_query,TEST_INPUT,$<))" = "$(call awk_query,TEST_OUTPUT,$<)" ]; \ 3 then echo Passed; \ 4 else echo Failed; \ 5 fi 6 7 %.test: % 8 @printf "Test: $<... " 9 @$(call test_cmd) 10 11 test: $(addsuffix .test,$(basename $(wildcard tests/*.c)))