]> granicus.if.org Git - esp-idf/commitdiff
build: Add TEST_EXCLUDE_COMPONENTS
authorKonstantin Kondrashov <konstantin@espressif.com>
Thu, 28 Jun 2018 09:54:15 +0000 (14:54 +0500)
committerKonstantin Kondrashov <konstantin@espressif.com>
Tue, 10 Jul 2018 08:44:41 +0000 (13:44 +0500)
To exclude during the build process of unit tests some components.

docs/en/api-guides/build-system.rst
docs/en/api-guides/unit-tests.rst
make/project.mk
tools/unit-test-app/Makefile

index e638a36d079934c6c7b11747aa45a5c45ba446cd..61680b4e1c8a0cea7378e0ee366b98d4bb0854e6 100644 (file)
@@ -124,6 +124,7 @@ These variables all have default values that can be overridden for custom behavi
 - ``EXTRA_COMPONENT_DIRS``: Optional list of additional directories to search for components.
 - ``COMPONENTS``: A list of component names to build into the project. Defaults to all components found in the COMPONENT_DIRS directories.
 - ``EXCLUDE_COMPONENTS``: Optional list of component names to exclude during the build process. Note that this decreases build time, but not binary size.
+- ``TEST_EXCLUDE_COMPONENTS``: Optional list of component names to exclude during the build process of unit tests.
 
 Any paths in these Makefile variables should be absolute paths. You can convert relative paths using ``$(PROJECT_PATH)/xxx``, ``$(IDF_PATH)/xxx``, or use the Make function ``$(abspath xxx)``.
 
index b6b1ff3428fafe7f1ff145783aeea6d474921dba..b9cfaa39da94b61435c4077a119808ff507c27ce 100644 (file)
@@ -120,6 +120,7 @@ Change into tools/unit-test-app directory to configure and build it:
 
 * `make TESTS_ALL=1` - build unit test app with tests for each component having tests in the ``test`` subdirectory.
 * `make TEST_COMPONENTS='xxx'` - build unit test app with tests for specific components. 
+* `make TESTS_ALL=1 TEST_EXCLUDE_COMPONENTS='xxx'` - build unit test app with all unit tests, except for unit tests of some components. (For instance: `make TESTS_ALL=1 TEST_EXCLUDE_COMPONENTS='ulp mbedtls'` - build all unit tests exludes ulp and mbedtls components).
 
 When the build finishes, it will print instructions for flashing the chip. You can simply run ``make flash`` to flash all build output.
 
index 10556b191f4b2e634da6744ba4915c83b1c6a554..bf84946720bb770d144e1a9e9a1fa814c357b1b4 100644 (file)
@@ -168,12 +168,13 @@ COMPONENT_PATHS := $(foreach comp,$(COMPONENTS),$(firstword $(foreach cd,$(COMPO
 export COMPONENT_PATHS
 
 TEST_COMPONENTS ?=
+TEST_EXCLUDE_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)
+TEST_COMPONENTS_LIST := $(filter-out $(TEST_EXCLUDE_COMPONENTS), $(COMPONENTS))
 else
 TEST_COMPONENTS_LIST := $(TEST_COMPONENTS)
 endif
@@ -534,11 +535,11 @@ list-components:
        $(info COMPONENT_DIRS (components searched for here))
        $(foreach cd,$(COMPONENT_DIRS),$(info $(cd)))
        $(info $(call dequote,$(SEPARATOR)))
-       $(info COMPONENTS (list of component names))
-       $(info $(COMPONENTS))
+       $(info TEST_COMPONENTS (list of test component names))
+       $(info $(TEST_COMPONENTS_LIST))
        $(info $(call dequote,$(SEPARATOR)))
-       $(info EXCLUDE_COMPONENTS (list of excluded names))
-       $(info $(if $(EXCLUDE_COMPONENTS),$(EXCLUDE_COMPONENTS),(none provided)))       
+       $(info TEST_EXCLUDE_COMPONENTS (list of test excluded names))
+       $(info $(if $(EXCLUDE_COMPONENTS) || $(TEST_EXCLUDE_COMPONENTS),$(EXCLUDE_COMPONENTS) $(TEST_EXCLUDE_COMPONENTS),(none provided)))      
        $(info $(call dequote,$(SEPARATOR)))
        $(info COMPONENT_PATHS (paths to all components):)
        $(foreach cp,$(COMPONENT_PATHS),$(info $(cp)))
index a7b3c45ff45a9d7984f1ec9c2835cb1d40ae6bca..293764399b09e0ea6342c70da491d7cecf9d794d 100644 (file)
@@ -69,6 +69,7 @@ $(BINARIES_DIR)/%/$(PROJECT_NAME).bin: configs/%
        # of tests to build for given configuration.
        # Build all tests if this option is not present.
        test_components=`sed -n 's/^TEST_COMPONENTS=\(.*\)/\1/p' configs/$*`; \
+               test_exclude_components=`sed -n 's/^TEST_EXCLUDE_COMPONENTS=\(.*\)/\1/p' configs/$*`; \
                tests_all=`test -n "$${test_components}"; echo $${?}`; \
                exclude_components=`sed -n 's/^EXCLUDE_COMPONENTS=\(.*\)/\1/p' configs/$*`; \
        $(MAKE) defconfig list-components all \
@@ -76,6 +77,7 @@ $(BINARIES_DIR)/%/$(PROJECT_NAME).bin: configs/%
                SDKCONFIG=$(BUILDS_DIR)/$*/sdkconfig \
                SDKCONFIG_DEFAULTS=$(BUILDS_DIR)/$*/sdkconfig.defaults \
                TEST_COMPONENTS="$${test_components}" \
+               TEST_EXCLUDE_COMPONENTS="$${test_exclude_components}" \
                TESTS_ALL=$${tests_all} \
                EXCLUDE_COMPONENTS="$${exclude_components}"
        $(MAKE) print_flash_cmd \