Makefile
2.9 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
APPLICATION = unittests
include ../Makefile.tests_common
BOARD_INSUFFICIENT_MEMORY := airfy-beacon cc2650stk chronos msb-430 msb-430h pca10000 \
pca10005 spark-core stm32f0discovery stm32f3discovery \
telosb wsn430-v1_3b wsn430-v1_4 z1 nucleo-f103 \
nucleo-f334 yunjia-nrf51822 samr21-xpro \
arduino-mega2560 airfy-beacon nrf51dongle nrf6310 \
weio waspmote-pro nucleo-f072 arduino-uno \
arduino-duemilanove sodaq-autonomo arduino-zero \
nucleo-f030 nucleo-f070 nucleo-f091 pba-d-01-kw2x \
saml21-xpro microbit calliope-mini limifrog-v1
USEMODULE += embunit
ifeq (, $(filter tests-%, $(MAKECMDGOALS)))
UNIT_TESTS := $(foreach d,$(wildcard tests-*/Makefile),$(shell dirname $(d)))
else
UNIT_TESTS := $(filter tests-%, $(MAKECMDGOALS))
endif
ARM7_BOARDS := msba2 avrextrem
DISABLE_TEST_FOR_ARM7 := tests-relic
ARM_CORTEX_M_BOARDS := airfy-beacon arduino-due cc2538dk ek-lm4f120xl f4vi1 fox frdm-k64f \
iotlab-m3 limifrog-v1 mbed_lpc1768 msbiot mulle nrf51dongle nrf6310 \
nucleo-f091 nucleo-f303 nucleo-f334 nucleo-f401 nucleo-l1 openmote-cc2538 \
pba-d-01-kw2x pca10000 pca10005 remote saml21-xpro samr21-xpro slwstk6220a \
spark-core stm32f0discovery stm32f3discovery stm32f4discovery udoo weio \
yunjia-nrf51822 sodaq-autonomo arduino-zero nucleo-f030 nucleo-f070
DISABLE_TEST_FOR_ARM_CORTEX_M := tests-relic
AVR_BOARDS := arduino-mega2560 waspmote-pro arduino-uno arduino-duemilanove
DISABLE_TEST_FOR_AVR := tests-relic
MSP430_BOARDS := chronos msb-430 msb-430h telosb wsn430-v1_3b wsn430-v1_4 z1
DISABLE_TEST_FOR_MSP430 := tests-relic
ifneq (, $(filter $(ARM7_BOARDS), $(BOARD)))
UNIT_TESTS := $(filter-out $(DISABLE_TEST_FOR_ARM7), $(UNIT_TESTS))
endif
ifneq (, $(filter $(ARM_CORTEX_M_BOARDS), $(BOARD)))
UNIT_TESTS := $(filter-out $(DISABLE_TEST_FOR_ARM_CORTEX_M), $(UNIT_TESTS))
endif
ifneq (, $(filter $(AVR_BOARDS), $(BOARD)))
UNIT_TESTS := $(filter-out $(DISABLE_TEST_FOR_AVR), $(UNIT_TESTS))
endif
ifneq (, $(filter $(MSP430_BOARDS), $(BOARD)))
UNIT_TESTS := $(filter-out $(DISABLE_TEST_FOR_AVR), $(UNIT_TESTS))
endif
DISABLE_MODULE += auto_init
# Pull in `Makefile.include`s from the test suites:
-include $(UNIT_TESTS:%=$(RIOTBASE)/tests/unittests/%/Makefile.include)
DIRS += $(UNIT_TESTS)
BASELIBS += $(UNIT_TESTS:%=$(BINDIR)/%.a)
INCLUDES += -I$(RIOTBASE)/tests/unittests/common
include $(RIOTBASE)/Makefile.include
.PHONY: $(UNIT_TESTS)
all:
$(UNIT_TESTS): all
charCOMMA := ,
ifeq (, $(UNIT_TESTS))
CFLAGS += -DNO_TEST_SUITES
$(warning There was no test suite specified!)
else
CFLAGS += -DTEST_SUITES='$(subst $() $(),$(charCOMMA),$(UNIT_TESTS:tests-%=%))'
endif
test:
./tests/01-run.py