forked from paparazzi/paparazzi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (32 loc) · 1.22 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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)")
NON_HARDWARE_TEST_DIRS = $(shell find -L * -maxdepth 1 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -Ev "$(HARDWARE_REGEX)")
ifneq ($(TARGET_BOARD),)
TEST_DIRECTORIES = $(TARGET_BOARD)
else
ifeq ($(TEST_HARDWARE),)
TEST_DIRECTORIES = $(NON_HARDWARE_TEST_DIRS)
else
TEST_DIRECTORIES = $(NON_HARDWARE_TEST_DIRS) $(HARDWARE_TEST_DIRS)
endif
endif
TEST_FILES ?= $(shell ls $(TEST_DIRECTORIES:%=%/*.t) 2> /dev/null)
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; exit TAP::Harness->new( { verbosity => $(TEST_VERBOSE), jobs => $(TEST_JOBS) } )->runtests(qw($(TEST_FILES)))->failed
endif
test:
$(Q)make -C math test
$(Q)$(PERLENV) $(PERL) "-e" "$(RUNTESTS)"
test_modules:
prove -v $(PAPARAZZI_HOME)/tests/modules/test_modules.py
clean:
$(Q)rm -rf results/*