From: laurenw-arm Date: Thu, 4 May 2023 19:55:37 +0000 (-0500) Subject: refactor(tc): define PLATFORM_TESTS for scale X-Git-Tag: baikal/aarch64/sdk5.10~1^2~11^2~4 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=6fbe11cd6628bc75667eb315a4a8b2f0fbe46f42;p=arm-tf.git refactor(tc): define PLATFORM_TESTS for scale For scalability when we add more tests in the future, add PLATFORM_TESTS macro when specific test flags, i.e. PLATFORM_TEST_NV_COUNTERS, are defined. Change-Id: Icb875a171dde673fca9fcf66624ac55383e7b641 Signed-off-by: Lauren Wehrmeister --- diff --git a/plat/arm/board/tc/platform.mk b/plat/arm/board/tc/platform.mk index 63a923795..5e27f029d 100644 --- a/plat/arm/board/tc/platform.mk +++ b/plat/arm/board/tc/platform.mk @@ -193,28 +193,32 @@ PLAT_INCLUDES += -Iinclude/lib/psa endif -ifeq (${PLATFORM_TEST},rss-nv-counters) - include drivers/arm/rss/rss_comms.mk +ifneq (${PLATFORM_TEST},) + $(eval $(call add_define,PLATFORM_TESTS)) + + ifeq (${PLATFORM_TEST},rss-nv-counters) + include drivers/arm/rss/rss_comms.mk - # Test code. - BL31_SOURCES += plat/arm/board/tc/nv_counter_test.c + # Test code. + BL31_SOURCES += plat/arm/board/tc/nv_counter_test.c - # Code under testing. - BL31_SOURCES += lib/psa/rss_platform.c \ + # Code under testing. + BL31_SOURCES += lib/psa/rss_platform.c \ drivers/arm/rss/rss_comms.c \ ${RSS_COMMS_SOURCES} - PLAT_INCLUDES += -Iinclude/lib/psa - - $(eval $(call add_define,PLATFORM_TEST_NV_COUNTERS)) -else ifeq (${PLATFORM_TEST},tfm-testsuite) - # Add this include as first, before arm_common.mk. This is necessary - # because arm_common.mk builds Mbed TLS, and platform_test.mk can - # change the list of Mbed TLS files that are to be compiled - # (LIBMBEDTLS_SRCS). - include plat/arm/board/tc/platform_test.mk -else ifneq (${PLATFORM_TEST},) - $(error "Unsupported PLATFORM_TEST value") + PLAT_INCLUDES += -Iinclude/lib/psa + + $(eval $(call add_define,PLATFORM_TEST_NV_COUNTERS)) + else ifeq (${PLATFORM_TEST},tfm-testsuite) + # Add this include as first, before arm_common.mk. This is necessary + # because arm_common.mk builds Mbed TLS, and platform_test.mk can + # change the list of Mbed TLS files that are to be compiled + # (LIBMBEDTLS_SRCS). + include plat/arm/board/tc/platform_test.mk + else + $(error "Unsupported PLATFORM_TEST value") + endif endif diff --git a/plat/arm/board/tc/tc_bl31_setup.c b/plat/arm/board/tc/tc_bl31_setup.c index 8ad1d3056..d2a14d287 100644 --- a/plat/arm/board/tc/tc_bl31_setup.c +++ b/plat/arm/board/tc/tc_bl31_setup.c @@ -53,7 +53,7 @@ void tc_bl31_common_platform_setup(void) { arm_bl31_platform_setup(); -#if defined(PLATFORM_TEST_NV_COUNTERS) || defined(PLATFORM_TEST_TFM_TESTSUITE) +#ifdef PLATFORM_TESTS #ifdef PLATFORM_TEST_NV_COUNTERS nv_counter_test(); #elif PLATFORM_TEST_TFM_TESTSUITE