Commits

Michał Górny  committed 428fcab

Keep-going when running tests and nicely report failed ones.

  • Participants
  • Parent commits 081f7b2

Comments (0)

Files changed (2)

 	[ ! -f tests/Makefile ] || make -C tests distclean
 
 check: $(PROG) tests/Makefile
-	$(MAKE) -C tests MIRAGE2ISO=../mirage2iso all
+	$(MAKE) -k -C tests MIRAGE2ISO=../mirage2iso all && echo 'All tests succeeded.' || ( cd tests/; echo; echo "$$(wc -l < tests-failed) of $$(wc -l < tests-list) tests failed. Failed tests are:"; cat tests-failed; echo; false )
 
 tests/Makefile: tests/tests-list tests/tests-gen.awk
 	awk -f tests/tests-gen.awk < $< > $@

File tests/tests-gen.awk

 	print "INPUT = 00_input.iso"
 	print
 	print "all: tests"
+	print "preclean:"
+	print "	rm -f tests-failed"
+
+	failpart = " || ( echo '	$<' >> tests-failed; false )"
 }
 
 {
-	print $2 ": " $1
-	print "	$(MIRAGE2ISO) -q -p test $< $@"
-	print "	cmp $(INPUT) $@"
+	print $2 ": " $1 " preclean"
+	print "	$(MIRAGE2ISO) -q -p test $< $@" failpart
+	print "	cmp $(INPUT) $@" failpart
 
 	all = all " " $2
 }