blob: f5414e27a39c8bd14f5d6c143f8763d4a1797162 [file] [log] [blame]
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02001#
2# Copyright (c) 2018, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
Sandrine Bailleux0c6ef872018-10-02 16:14:58 +02007TESTS ?= standard
Sandrine Bailleuxd78c03d2018-09-25 15:44:39 +02008
Sandrine Bailleux043d5362018-10-03 17:05:59 +02009tests_files := $(wildcard tftf/tests/*.xml)
10tests_sets := $(patsubst tftf/tests/tests-%.xml,%,${tests_files})
11
12PHONY: help_tests
13help_tests:
14 @echo "Available sets of tests:"
15 @$(foreach t, ${tests_sets}, printf " - %s\n" ${t};)
16
Sandrine Bailleuxd78c03d2018-09-25 15:44:39 +020017TESTS_FILE := tftf/tests/tests-${TESTS}.xml
18TESTS_MAKEFILE := tftf/tests/tests-${TESTS}.mk
19
20# Check that the selected tests file and makefile exist.
21ifeq (,$(wildcard ${TESTS_FILE}))
22 $(error "Tests file tftf/tests/tests-${TESTS}.xml does not exist.")
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020023endif
24
Sandrine Bailleuxd78c03d2018-09-25 15:44:39 +020025ifeq (,$(wildcard ${TESTS_MAKEFILE}))
26 $(error "Tests makefile tftf/tests/tests-${TESTS}.mk does not exist.")
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020027endif
28
Sandrine Bailleuxfe6ff412018-10-16 10:20:38 +020029# Initialize variable before including all sub-makefiles that will append source
30# files to it.
31TESTS_SOURCES :=
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020032
Sandrine Bailleuxd78c03d2018-09-25 15:44:39 +020033include ${TESTS_MAKEFILE}
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020034
Sandrine Bailleuxfe6ff412018-10-16 10:20:38 +020035# Some source files might be included by several test makefiles.
36# Remove duplicate ones.
37TESTS_SOURCES := $(sort ${TESTS_SOURCES})