2018-01-25 16:24:37 +01:00
|
|
|
DEVELHELP ?= 0
|
2014-04-07 15:15:25 +02:00
|
|
|
include ../Makefile.tests_common
|
|
|
|
|
|
|
|
USEMODULE += embunit
|
|
|
|
|
2023-05-02 13:48:08 +02:00
|
|
|
ifeq (, $(UNIT_TESTS))
|
|
|
|
ifeq (, $(filter tests-%, $(MAKECMDGOALS)))
|
|
|
|
# the $(dir) Makefile function leaves a trailing slash after the directory
|
|
|
|
# name, therefore we use patsubst instead.
|
|
|
|
UNIT_TESTS := $(patsubst %/Makefile,%,$(wildcard tests-*/Makefile))
|
|
|
|
else
|
|
|
|
UNIT_TESTS := $(filter tests-%, $(MAKECMDGOALS))
|
|
|
|
endif
|
2014-05-14 11:13:53 +02:00
|
|
|
endif
|
2014-04-07 15:15:25 +02:00
|
|
|
|
2023-09-29 10:38:43 +02:00
|
|
|
ifeq (llvm,$(TOOLCHAIN))
|
|
|
|
# the floating point exception bug is more likely to trigger when build
|
|
|
|
# with LLVM, so we just disable LLVM on native as a work around
|
|
|
|
TEST_ON_CI_BLACKLIST += native
|
|
|
|
endif
|
|
|
|
|
2020-03-30 11:26:32 +02:00
|
|
|
DISABLE_MODULE += auto_init auto_init_%
|
2014-08-21 20:45:36 +02:00
|
|
|
|
2020-09-22 14:41:44 +02:00
|
|
|
# boards using stdio via CDC ACM require auto_init to automatically
|
|
|
|
# initialize stdio over USB.
|
|
|
|
FEATURES_BLACKLIST += highlevel_stdio
|
2020-03-17 16:44:48 +01:00
|
|
|
|
2014-05-18 16:17:02 +02:00
|
|
|
# Pull in `Makefile.include`s from the test suites:
|
|
|
|
-include $(UNIT_TESTS:%=$(RIOTBASE)/tests/unittests/%/Makefile.include)
|
|
|
|
|
2014-06-18 11:21:05 +02:00
|
|
|
DIRS += $(UNIT_TESTS)
|
2020-08-10 14:45:39 +02:00
|
|
|
BASELIBS += $(UNIT_TESTS:%=%.module)
|
2014-05-14 11:13:53 +02:00
|
|
|
|
2015-03-20 19:57:08 +01:00
|
|
|
INCLUDES += -I$(RIOTBASE)/tests/unittests/common
|
2014-05-14 11:13:53 +02:00
|
|
|
|
2020-06-25 16:12:23 +02:00
|
|
|
# some tests need more stack
|
|
|
|
CFLAGS += -DTHREAD_STACKSIZE_MAIN=THREAD_STACKSIZE_LARGE
|
|
|
|
|
2022-05-11 21:49:57 +02:00
|
|
|
# for these boards, enable asan (Address Sanitizer)
|
|
|
|
ASAN_BOARDS ?= native
|
|
|
|
ifneq (, $(filter $(BOARD), $(ASAN_BOARDS)))
|
|
|
|
CFLAGS += $(CFLAGS_ASAN)
|
|
|
|
LINKFLAGS += $(LINKFLAGS_ASAN)
|
|
|
|
endif
|
|
|
|
|
2015-03-20 19:57:08 +01:00
|
|
|
include $(RIOTBASE)/Makefile.include
|
2014-08-08 19:21:03 +02:00
|
|
|
|
2016-07-05 16:06:33 +02:00
|
|
|
.PHONY: $(UNIT_TESTS)
|
2014-08-27 14:04:22 +02:00
|
|
|
|
2016-07-05 16:06:33 +02:00
|
|
|
all:
|
2014-08-27 14:04:22 +02:00
|
|
|
|
2018-03-21 14:38:57 +01:00
|
|
|
info-unittests:
|
|
|
|
@echo $(UNIT_TESTS)
|
|
|
|
|
2016-07-05 16:06:33 +02:00
|
|
|
$(UNIT_TESTS): all
|
2014-05-14 11:13:53 +02:00
|
|
|
|
2014-05-14 12:21:20 +02:00
|
|
|
ifeq (, $(UNIT_TESTS))
|
2017-09-22 12:01:15 +02:00
|
|
|
CFLAGS += -DNO_TEST_SUITES
|
|
|
|
$(warning There was no test suite specified!)
|
2014-05-14 12:21:20 +02:00
|
|
|
else
|
2020-10-09 11:49:23 +02:00
|
|
|
CFLAGS += -DTEST_SUITES='$(subst $() $(),$(comma),$(UNIT_TESTS:tests-%=%))'
|
2014-05-14 12:21:20 +02:00
|
|
|
endif
|