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}) |
| 11 | |
| 12 | PHONY: help_tests |
| 13 | help_tests: |
| 14 | @echo "Available sets of tests:" |
| 15 | @$(foreach t, ${tests_sets}, printf " - %s\n" ${t};) |
| 16 | |
Sandrine Bailleux | d78c03d | 2018-09-25 15:44:39 +0200 | [diff] [blame] | 17 | TESTS_FILE := tftf/tests/tests-${TESTS}.xml |
| 18 | TESTS_MAKEFILE := tftf/tests/tests-${TESTS}.mk |
| 19 | |
| 20 | # Check that the selected tests file and makefile exist. |
| 21 | ifeq (,$(wildcard ${TESTS_FILE})) |
| 22 | $(error "Tests file tftf/tests/tests-${TESTS}.xml does not exist.") |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 23 | endif |
| 24 | |
Sandrine Bailleux | d78c03d | 2018-09-25 15:44:39 +0200 | [diff] [blame] | 25 | ifeq (,$(wildcard ${TESTS_MAKEFILE})) |
| 26 | $(error "Tests makefile tftf/tests/tests-${TESTS}.mk does not exist.") |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 27 | endif |
| 28 | |
Sandrine Bailleux | fe6ff41 | 2018-10-16 10:20:38 +0200 | [diff] [blame] | 29 | # Initialize variable before including all sub-makefiles that will append source |
| 30 | # files to it. |
| 31 | TESTS_SOURCES := |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 32 | |
Sandrine Bailleux | d78c03d | 2018-09-25 15:44:39 +0200 | [diff] [blame] | 33 | include ${TESTS_MAKEFILE} |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 34 | |
Sandrine Bailleux | fe6ff41 | 2018-10-16 10:20:38 +0200 | [diff] [blame] | 35 | # Some source files might be included by several test makefiles. |
| 36 | # Remove duplicate ones. |
| 37 | TESTS_SOURCES := $(sort ${TESTS_SOURCES}) |