Files
paparazzi/tests/Makefile
T
Bernard Davison 6dbf1183bd 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
2012-03-05 15:08:23 +11:00

20 lines
500 B
Makefile

Q = @
PERL = perl
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:
$(Q)$(PERLENV) $(PERL) "-e" "$(RUNTESTS)"