]> granicus.if.org Git - esp-idf/commitdiff
build system: fix building tests specified via TEST_COMPONENTS
authorIvan Grokhotkov <ivan@espressif.com>
Tue, 5 Sep 2017 10:07:00 +0000 (18:07 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Tue, 5 Sep 2017 10:07:00 +0000 (18:07 +0800)
make/project.mk

index 9846872a28626676418f55aa7d5df05f29f5b121..ec4352cd7efb694de27cbe47e4ee480b67d405db 100644 (file)
@@ -147,17 +147,17 @@ export COMPONENTS
 # can use $(notdir x) to get the component name.
 COMPONENT_PATHS := $(foreach comp,$(COMPONENTS),$(firstword $(foreach cd,$(COMPONENT_DIRS),$(wildcard $(dir $(cd))$(comp) $(cd)/$(comp)))))
 
-# If TESTS_ALL set to 1, set TEST_COMPONENTS_LIST to all components
-ifdef TESTS_ALL
+TEST_COMPONENTS ?=
+TESTS_ALL ?=
+
+# If TESTS_ALL set to 1, set TEST_COMPONENTS_LIST to all components.
+# Otherwise, use the list supplied in TEST_COMPONENTS.
 ifeq ($(TESTS_ALL),1)
 TEST_COMPONENTS_LIST := $(COMPONENTS)
-else  # TESTS_ALL not empty and not 1
-# otherwise, use TEST_COMPONENTS
+else
 TEST_COMPONENTS_LIST := $(TEST_COMPONENTS)
 endif
-else  # TESTS_ALL unset
-TEST_COMPONENTS_LIST :=
-endif
+
 TEST_COMPONENT_PATHS := $(foreach comp,$(TEST_COMPONENTS_LIST),$(firstword $(foreach dir,$(COMPONENT_DIRS),$(wildcard $(dir)/$(comp)/test))))
 TEST_COMPONENT_NAMES := $(foreach comp,$(TEST_COMPONENT_PATHS),$(lastword $(subst /, ,$(dir $(comp))))_test)