Adding JUnit result output

The JUnit results can be added by specifying JUNIT=1 from the make
command line.

This is important as the Bamboo server can read JUnit results and
include them in the build reports.

This requires that the Perl module TAP::Formatter::JUnit is installed
on the host that the command is run on.
The JUnit results are created under tests/results and have the name
ABC.junit.xml
This commit is contained in:
Bernard Davison
2012-03-05 15:08:23 +11:00
parent 0c1bc178a4
commit 6dbf1183bd
2 changed files with 15 additions and 5 deletions
+14 -5
View File
@@ -1,10 +1,19 @@
Q = @
PERL = perl
TEST_VERBOSE=0
ifeq ($(AIRCRAFT),)
AIRCRAFT=*
TEST_VERBOSE = 0
ifeq ($(TARGET_BOARD),)
TARGET_BOARD = *
endif
TEST_FILES := $(shell ls $(TARGET_BOARD)/*.t)
ifneq ($(JUNIT),)
PERLENV=PERL_TEST_HARNESS_DUMP_TAP=$(PAPARAZZI_SRC)/tests/results
RUNTESTS=use TAP::Harness; TAP::Harness->new({ formatter_class => 'TAP::Formatter::JUnit', merge => 1, } )->runtests(qw($(TEST_FILES)))
else
PERLENV=
RUNTESTS=use TAP::Harness;TAP::Harness->new()->runtests(qw($(TEST_FILES)))
endif
TEST_FILES = $(AIRCRAFT)/*.t
test:
$(PERL) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE))" $(TEST_FILES)
$(Q)$(PERLENV) $(PERL) "-e" "$(RUNTESTS)"