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>
This commit is contained in:
Patrick Georgi 2020-05-27 11:39:32 +02:00
parent 95226b3e74
commit 1b35ec97cc
1 changed files with 13 additions and 5 deletions

View File

@ -141,17 +141,25 @@ $(alltests): export CMOCKA_XML_FILE=$(testobj)/junit-$(subst /,_,$^).xml
endif endif
$(alltests): $$($$(@)-bin) $(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 unit-tests: build-unit-tests run-unit-tests
build-unit-tests: $(test-bins) build-unit-tests: $(test-bins)
run-unit-tests: $(alltests) run-unit-tests: $(alltests)
echo "**********************" if [ `find $(testobj) -name '*.failed' | wc -l` -gt 0 ]; then \
echo " ALL TESTS PASSED" echo "**********************"; \
echo "**********************" echo " TESTS FAILED"; \
echo "**********************"; \
exit 1; \
else \
echo "**********************"; \
echo " ALL TESTS PASSED"; \
echo "**********************"; \
exit 0; \
fi
$(addprefix clean-,$(alltests)): clean-%: $(addprefix clean-,$(alltests)): clean-%:
rm -rf $(obj)/$* rm -rf $(obj)/$*