From a0a198f7792e1c3eead192f73abf2d75fa723936 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Wed, 27 May 2020 10:59:09 +0200 Subject: tests: Allow emitting junit output for unit tests Change-Id: Iab0c4250b1baa77d4eab7538ec1fd3310f9e63e4 Signed-off-by: Patrick Georgi Reviewed-on: https://review.coreboot.org/c/coreboot/+/41771 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth Reviewed-by: Angel Pons Reviewed-by: Jan Dabros --- tests/Makefile.inc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/Makefile.inc b/tests/Makefile.inc index f84fa30d5249..2da29c376891 100644 --- a/tests/Makefile.inc +++ b/tests/Makefile.inc @@ -135,7 +135,13 @@ $(TEST_KCONFIG_AUTOCONFIG): $(TEST_KCONFIG_AUTOHEADER) .PHONY: $(alltests) $(addprefix clean-,$(alltests)) .PHONY: unit-tests build-unit-tests run-unit-tests clean-unit-tests +ifeq ($(JUNIT_OUTPUT),y) +$(alltests): export CMOCKA_MESSAGE_OUTPUT=xml +$(alltests): export CMOCKA_XML_FILE=$(testobj)/junit-$(subst /,_,$^).xml +endif + $(alltests): $$($$(@)-bin) + rm -f $(testobj)/junit-$(subst /,_,$^).xml ./$^ unit-tests: build-unit-tests run-unit-tests -- cgit v1.2.3