]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
refactor(tc): define PLATFORM_TESTS for scale
authorlaurenw-arm <lauren.wehrmeister@arm.com>
Thu, 4 May 2023 19:55:37 +0000 (14:55 -0500)
committerlaurenw-arm <lauren.wehrmeister@arm.com>
Fri, 5 May 2023 20:41:37 +0000 (15:41 -0500)
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 <lauren.wehrmeister@arm.com>
plat/arm/board/tc/platform.mk
plat/arm/board/tc/tc_bl31_setup.c

index 63a923795340dbdd9fb8c4356e79776caf4da67f..5e27f029df3fb75313a6bbdc8389d4977cde8e23 100644 (file)
@@ -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
 
 
index 8ad1d30563c6169dc446c5c2dca376c9c840f67c..d2a14d2877524341eac57146658347d775fae0d2 100644 (file)
@@ -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