Introduce support to build a subset of tests
The build system now supports building a TFTF binary with a subset of
tests. The chosen subset may be specified through the TESTS variable,
e.g.:
make TESTS=sdei tftf
make TESTS=tsp tftf
make TESTS=cpu-extensions tftf
This will use tftf/tests/tests-${TESTS}.xml as the tests manifest
and tftf/tests/tests-${TESTS}.mk as the tests makefile.
This provides more flexibility than before. It is still possible to
compile all the tests using:
make TESTS=common tftf
It's also possible to include the extensive tests using:
make TESTS=extensive tftf
If TESTS is not specified, it defaults to the 'common' tests.
Change-Id: Ifcdc52e9a29ed5f9a9bf57703cdb109b5a169fa2
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
diff --git a/tftf/tests/tests.mk b/tftf/tests/tests.mk
index 3a4e42f..77b070d 100644
--- a/tftf/tests/tests.mk
+++ b/tftf/tests/tests.mk
@@ -4,41 +4,25 @@
# SPDX-License-Identifier: BSD-3-Clause
#
-# Path to the XML file listing the tests to run. If there is a platform-specific
-# test file, use it. If not, use the common one. If the user specified another
-# one, use that one instead.
-ifneq ($(wildcard ${PLAT_PATH}/tests.xml),)
- TESTS_FILE := ${PLAT_PATH}/tests.xml
-else
- TESTS_FILE := tftf/tests/tests-common.xml
+TESTS ?= common
+
+TESTS_FILE := tftf/tests/tests-${TESTS}.xml
+TESTS_MAKEFILE := tftf/tests/tests-${TESTS}.mk
+
+# Check that the selected tests file and makefile exist.
+ifeq (,$(wildcard ${TESTS_FILE}))
+ $(error "Tests file tftf/tests/tests-${TESTS}.xml does not exist.")
endif
-# Check that the selected tests file exists.
-ifeq (,$(wildcard ${TESTS_FILE}))
- $(error "The file TESTS_FILE points to cannot be found")
+ifeq (,$(wildcard ${TESTS_MAKEFILE}))
+ $(error "Tests makefile tftf/tests/tests-${TESTS}.mk does not exist.")
endif
# Initialize variable before including all sub-makefiles that will append source
# files to it.
TESTS_SOURCES :=
-include tftf/tests/tests-arm-state-switch.mk
-include tftf/tests/tests-boot-req.mk
-include tftf/tests/tests-cpu-extensions.mk
-include tftf/tests/tests-el3-power-state.mk
-include tftf/tests/tests-fwu.mk
-include tftf/tests/tests-manual.mk
-include tftf/tests/tests-performance.mk
-include tftf/tests/tests-psci-extensive.mk
-include tftf/tests/tests-psci.mk
-include tftf/tests/tests-runtime-instrumentation.mk
-include tftf/tests/tests-sdei.mk
-include tftf/tests/tests-single-fault.mk
-include tftf/tests/tests-spm.mk
-include tftf/tests/tests-template.mk
-include tftf/tests/tests-tftf-validation.mk
-include tftf/tests/tests-tsp.mk
-include tftf/tests/tests-uncontainable.mk
+include ${TESTS_MAKEFILE}
# Some source files might be included by several test makefiles.
# Remove duplicate ones.