From 1b35ec97cc54337680e239c7ad10fa1acc716a2f Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Wed, 27 May 2020 11:39:32 +0200 Subject: tests: Always run all unit tests So far, the semantics have been that run-unit-tests stopped at the first test suite that failed. This hides useful signal in later tests, so always run all tests and collect the result. Change-Id: I407715f85513c2c95a1cf89cfb427317dff9fbab Signed-off-by: Patrick Georgi Reviewed-on: https://review.coreboot.org/c/coreboot/+/41773 Tested-by: build bot (Jenkins) Reviewed-by: Jan Dabros Reviewed-by: Martin Roth Reviewed-by: Angel Pons --- tests/Makefile.inc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/Makefile.inc b/tests/Makefile.inc index 2da29c3768..bfd18060ab 100644 --- a/tests/Makefile.inc +++ b/tests/Makefile.inc @@ -141,17 +141,25 @@ $(alltests): export CMOCKA_XML_FILE=$(testobj)/junit-$(subst /,_,$^).xml endif $(alltests): $$($$(@)-bin) - rm -f $(testobj)/junit-$(subst /,_,$^).xml - ./$^ + rm -f $(testobj)/junit-$(subst /,_,$^).xml $(testobj)/$(subst /,_,$^).failed + -./$^ || echo failed > $(testobj)/$(subst /,_,$^).failed unit-tests: build-unit-tests run-unit-tests build-unit-tests: $(test-bins) run-unit-tests: $(alltests) - echo "**********************" - echo " ALL TESTS PASSED" - echo "**********************" + if [ `find $(testobj) -name '*.failed' | wc -l` -gt 0 ]; then \ + echo "**********************"; \ + echo " TESTS FAILED"; \ + echo "**********************"; \ + exit 1; \ + else \ + echo "**********************"; \ + echo " ALL TESTS PASSED"; \ + echo "**********************"; \ + exit 0; \ + fi $(addprefix clean-,$(alltests)): clean-%: rm -rf $(obj)/$* -- cgit v1.2.3