Test: Add an option flag to control multi-core tests

Add an option flag TFM_MULTI_CORE_TEST to control multi-core
specific tests. The multi-core platform should explicitly set it to
ON to enable multi-core tests.

Change-Id: I3f6e6aaa0ecaa109db1a503a26e05bb52f12f07c
Signed-off-by: David Hu <david.hu@arm.com>
diff --git a/CommonConfig.cmake b/CommonConfig.cmake
index 6254cdb..7550ae3 100644
--- a/CommonConfig.cmake
+++ b/CommonConfig.cmake
@@ -85,6 +85,9 @@
 else()
 	set (CMSE_FLAGS "-mcmse")
 	set (ARM_FEATURE_CMSE 3)
+
+	# Clear multi-core test setting
+	set (TFM_MULTI_CORE_TEST OFF)
 endif()
 
 if(${COMPILER} STREQUAL "ARMCLANG")
@@ -191,6 +194,11 @@
 
 if (DEFINED TFM_MULTI_CORE_TOPOLOGY AND TFM_MULTI_CORE_TOPOLOGY)
 	add_definitions(-DTFM_MULTI_CORE_TOPOLOGY)
+
+	# Skip multi-core test cases if regression test is disabled
+	if (NOT REGRESSION)
+		set(TFM_MULTI_CORE_TEST OFF)
+	endif()
 endif()
 
 if (TFM_LEGACY_API)
diff --git a/secure_fw/CMakeLists.txt b/secure_fw/CMakeLists.txt
index f59e1ef..73a14da 100644
--- a/secure_fw/CMakeLists.txt
+++ b/secure_fw/CMakeLists.txt
@@ -310,6 +310,11 @@
 		embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_ENABLE_IRQ_TEST")
 	endif()
 
+	if (TFM_MULTI_CORE_TEST)
+		add_definitions(-DTFM_MULTI_CORE_TEST)
+		embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_MULTI_CORE_TEST")
+	endif()
+
 	#Generate binary file from executable
 	compiler_generate_binary_output(${EXE_NAME})