summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2020-05-27 11:39:32 +0200
committerPatrick Georgi <pgeorgi@google.com>2020-05-28 09:48:13 +0000
commit1b35ec97cc54337680e239c7ad10fa1acc716a2f (patch)
tree394bf4788c5d988a2bbc6ae085b0ee56145725c4 /tests
parent95226b3e74309650325b2e2199a90d670a99c452 (diff)
downloadcoreboot-1b35ec97cc54337680e239c7ad10fa1acc716a2f.tar.xz
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 <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/41773 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jan Dabros <jsd@semihalf.com> Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.inc18
1 files changed, 13 insertions, 5 deletions
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)/$*