Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 1 | # |
| 2 | # Copyright (c) 2018, Arm Limited. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
Sandrine Bailleux | 0c6ef87 | 2018-10-02 16:14:58 +0200 | [diff] [blame] | 7 | TESTS ?= standard |
Sandrine Bailleux | d78c03d | 2018-09-25 15:44:39 +0200 | [diff] [blame] | 8 | |
Sandrine Bailleux | 043d536 | 2018-10-03 17:05:59 +0200 | [diff] [blame] | 9 | tests_files := $(wildcard tftf/tests/*.xml) |
| 10 | tests_sets := $(patsubst tftf/tests/tests-%.xml,%,${tests_files}) |
Leonardo Sandoval | d9fcb24 | 2020-07-14 11:09:45 -0500 | [diff] [blame] | 11 | tests_sets := $(sort ${tests_sets}) |
Sandrine Bailleux | 043d536 | 2018-10-03 17:05:59 +0200 | [diff] [blame] | 12 | |
| 13 | PHONY: help_tests |
| 14 | help_tests: |
Leonardo Sandoval | d9fcb24 | 2020-07-14 11:09:45 -0500 | [diff] [blame] | 15 | @echo "Supported Tests:" |
| 16 | @$(foreach t, ${tests_sets}, printf " %s\n" ${t};) |
Sandrine Bailleux | 043d536 | 2018-10-03 17:05:59 +0200 | [diff] [blame] | 17 | |
Sandrine Bailleux | d78c03d | 2018-09-25 15:44:39 +0200 | [diff] [blame] | 18 | TESTS_FILE := tftf/tests/tests-${TESTS}.xml |
| 19 | TESTS_MAKEFILE := tftf/tests/tests-${TESTS}.mk |
| 20 | |
| 21 | # Check that the selected tests file and makefile exist. |
| 22 | ifeq (,$(wildcard ${TESTS_FILE})) |
| 23 | $(error "Tests file tftf/tests/tests-${TESTS}.xml does not exist.") |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 24 | endif |
| 25 | |
Sandrine Bailleux | d78c03d | 2018-09-25 15:44:39 +0200 | [diff] [blame] | 26 | ifeq (,$(wildcard ${TESTS_MAKEFILE})) |
| 27 | $(error "Tests makefile tftf/tests/tests-${TESTS}.mk does not exist.") |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 28 | endif |
| 29 | |
Sandrine Bailleux | fe6ff41 | 2018-10-16 10:20:38 +0200 | [diff] [blame] | 30 | # Initialize variable before including all sub-makefiles that will append source |
| 31 | # files to it. |
| 32 | TESTS_SOURCES := |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 33 | |
Sandrine Bailleux | d78c03d | 2018-09-25 15:44:39 +0200 | [diff] [blame] | 34 | include ${TESTS_MAKEFILE} |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 35 | |
Sandrine Bailleux | fe6ff41 | 2018-10-16 10:20:38 +0200 | [diff] [blame] | 36 | # Some source files might be included by several test makefiles. |
| 37 | # Remove duplicate ones. |
| 38 | TESTS_SOURCES := $(sort ${TESTS_SOURCES}) |