Skip to content

Commit

Permalink
[tests] use conf.xml and exit with number of failed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
flixr committed Aug 27, 2014
1 parent b5470cb commit 4275468
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Q = @
PERL = /usr/bin/perl
TEST_VERBOSE = 0
TEST_JOBS ?= 1
NON_TEST_DIRS = lib|results
HARDWARE_REGEX = Lisa|Tiny|Umarim
HARDWARE_TEST_DIRS = $(shell find -L * -maxdepth 1 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -E "$(HARDWARE_REGEX)")
Expand All @@ -14,14 +15,14 @@ else
TEST_DIRECTORIES = $(NON_HARDWARE_TEST_DIRS) $(HARDWARE_TEST_DIRS)
endif
endif
TEST_FILES := $(shell ls $(TEST_DIRECTORIES:%=%/*.t))
TEST_FILES ?= $(shell ls $(TEST_DIRECTORIES:%=%/*.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', verbosity => $(TEST_VERBOSE), merge => 1, } )->runtests(qw($(TEST_FILES)))
else
PERLENV=
RUNTESTS=use TAP::Harness;TAP::Harness->new( { verbosity => $(TEST_VERBOSE) } )->runtests(qw($(TEST_FILES)))
RUNTESTS=use TAP::Harness; exit TAP::Harness->new( { verbosity => $(TEST_VERBOSE), jobs => $(TEST_JOBS) } )->runtests(qw($(TEST_FILES)))->failed
endif

test:
Expand Down
2 changes: 1 addition & 1 deletion tests/examples/01_compile_all_test_targets.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use Data::Dumper;
use Config;

$|++;
my $examples = XMLin("$ENV{'PAPARAZZI_SRC'}/conf/conf_tests.xml");
my $examples = XMLin("$ENV{'PAPARAZZI_SRC'}/conf/conf.xml");
my $xmlSimple = XML::Simple->new(ForceArray => 1);

use Data::Dumper;
Expand Down

0 comments on commit 4275468

Please sign in to comment.