From bf768cbccbdd3b89871299a0fbda08523cb45ddf Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Tue, 2 May 2023 13:48:08 +0200 Subject: [PATCH] tests/unittests: allow passing `UNIT_TESTS` via env --- tests/unittests/Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/unittests/Makefile b/tests/unittests/Makefile index ea1caca504..2d3fb7472f 100644 --- a/tests/unittests/Makefile +++ b/tests/unittests/Makefile @@ -3,12 +3,14 @@ include ../Makefile.tests_common USEMODULE += embunit -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)) +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 endif DISABLE_MODULE += auto_init auto_init_%