blob: ebe090c1a92071e13f2420c4ed1b9b81759aa920 [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})
Leonardo Sandovald9fcb242020-07-14 11:09:45 -050011tests_sets := $(sort ${tests_sets})
Sandrine Bailleux043d5362018-10-03 17:05:59 +020012
13PHONY: help_tests
14help_tests:
Leonardo Sandovald9fcb242020-07-14 11:09:45 -050015 @echo "Supported Tests:"
16 @$(foreach t, ${tests_sets}, printf " %s\n" ${t};)
Sandrine Bailleux043d5362018-10-03 17:05:59 +020017
Sandrine Bailleuxd78c03d2018-09-25 15:44:39 +020018TESTS_FILE := tftf/tests/tests-${TESTS}.xml
19TESTS_MAKEFILE := tftf/tests/tests-${TESTS}.mk
20
21# Check that the selected tests file and makefile exist.
22ifeq (,$(wildcard ${TESTS_FILE}))
23 $(error "Tests file tftf/tests/tests-${TESTS}.xml does not exist.")
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020024endif
25
Sandrine Bailleuxd78c03d2018-09-25 15:44:39 +020026ifeq (,$(wildcard ${TESTS_MAKEFILE}))
27 $(error "Tests makefile tftf/tests/tests-${TESTS}.mk does not exist.")
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020028endif
29
Sandrine Bailleuxfe6ff412018-10-16 10:20:38 +020030# Initialize variable before including all sub-makefiles that will append source
31# files to it.
32TESTS_SOURCES :=
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020033
Sandrine Bailleuxd78c03d2018-09-25 15:44:39 +020034include ${TESTS_MAKEFILE}
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020035
Sandrine Bailleuxfe6ff412018-10-16 10:20:38 +020036# Some source files might be included by several test makefiles.
37# Remove duplicate ones.
38TESTS_SOURCES := $(sort ${TESTS_SOURCES})