tests: Fix JUNIT_OUTPUT=y to write to files instead of stderr
commit4d9694e6bc39b0447d70e96186b9bf707a08f038
authorJakub Czapiga <jacz@semihalf.com>
Thu, 7 Oct 2021 09:06:42 +0000 (7 09:06 +0000)
committerFelix Held <felix-coreboot@felixheld.de>
Mon, 11 Oct 2021 12:55:36 +0000 (11 12:55 +0000)
treed3c3f5f02d0d2095e2c6d885ab6b2a59bae87bf9
parent64fb9fc53e6fbadc91cadfb823a6c34d89eb8f72
tests: Fix JUNIT_OUTPUT=y to write to files instead of stderr

CB:57144 broke JUNIT_OUTPUT=y, and unit-tests were writing to stderr
instead of selected XML files, because test name used for XML file
creation contains test path. Build system did not create necessary
directiories, which CMocka required to create output files.
This commit fixes writing to XML files with JUNIT_OUTPUT=y, but had to
sacrifice path in test name, as it was causing a lot of problems
(because CMocka does not know, how to write multiple test groups to one
XML file, so it uses test group name [here __TEST_NAME__(test_group)] as
part of output filename).
Example:
 Test: tests/lib/rtc-test
 Output file:
 `build/tests/junit-tests_lib_rtc-test(tests).xml

Change-Id: I09891aca923bf1271cafeaa09f89b6539022709c
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58163
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
tests/Makefile.inc