aboutsummaryrefslogtreecommitdiff
path: root/tftf/tests/tests.mk
blob: f5414e27a39c8bd14f5d6c143f8763d4a1797162 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#
# Copyright (c) 2018, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#

TESTS ?= standard

tests_files	:= $(wildcard tftf/tests/*.xml)
tests_sets	:= $(patsubst tftf/tests/tests-%.xml,%,${tests_files})

PHONY: help_tests
help_tests:
	@echo "Available sets of tests:"
	@$(foreach t, ${tests_sets}, printf " - %s\n" ${t};)

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

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 ${TESTS_MAKEFILE}

# Some source files might be included by several test makefiles.
# Remove duplicate ones.
TESTS_SOURCES := $(sort ${TESTS_SOURCES})