Build: set SST_TEST_NV_COUNTERS for SST regression
The SST_TEST_NV_COUNTERS should be set to ON only when SST regression
is ON for all level of isolation.
This patch first moves out the test configurations out of
test/CMakeLists.txt to a seperate file for CommonConfig.cmake to
include and then set SST_TEST_NV_COUNTERS to on when SST regression
is on.
Change-Id: Icc7c7086023d73f2570ef27233abc2cdc0c480e0
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/CommonConfig.cmake b/CommonConfig.cmake
index 27bfef5..f0ce1b6 100644
--- a/CommonConfig.cmake
+++ b/CommonConfig.cmake
@@ -254,6 +254,8 @@
set(TFM_PARTITION_AUDIT_LOG OFF)
endif()
+include(${CMAKE_CURRENT_LIST_DIR}/test/TestConfig.cmake)
+
if (TFM_PARTITION_AUDIT_LOG)
add_definitions(-DTFM_PARTITION_AUDIT_LOG)
endif()
@@ -341,7 +343,7 @@
endif()
if (NOT DEFINED SST_TEST_NV_COUNTERS)
- if (REGRESSION AND (TFM_LVL EQUAL 1))
+ if (REGRESSION AND ENABLE_SECURE_STORAGE_SERVICE_TESTS)
set(SST_TEST_NV_COUNTERS ON)
else()
set(SST_TEST_NV_COUNTERS OFF)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index f01fc56..46602e1 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -75,13 +75,8 @@
set(TFM_ENABLE_PERIPH_ACCESS_TEST FALSE)
endif()
-option(ENABLE_SECURE_STORAGE_SERVICE_TESTS "Option for secure storage service tests" TRUE)
-option(ENABLE_INTERNAL_TRUSTED_STORAGE_SERVICE_TESTS "Option for internal trusted storage services tests" TRUE)
-option(ENABLE_AUDIT_LOGGING_SERVICE_TESTS "Option for audit logging service tests" TRUE)
-option(ENABLE_CRYPTO_SERVICE_TESTS "Option for crypto service tests" TRUE)
-option(ENABLE_ATTESTATION_SERVICE_TESTS "Option for attestation service tests" TRUE)
-option(ENABLE_PLATFORM_SERVICE_TESTS "Option for platform service tests" TRUE)
-option(ENABLE_QCBOR_TESTS "Option for qcbor tests" TRUE)
+include(${CMAKE_CURRENT_LIST_DIR}/TestConfig.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/CMakeLists.inc)
if (ENABLE_SECURE_STORAGE_SERVICE_TESTS)
embedded_set_target_compile_defines(TARGET tfm_secure_tests LANGUAGE C DEFINES ENABLE_SECURE_STORAGE_SERVICE_TESTS APPEND)
@@ -122,8 +117,6 @@
embedded_set_target_compile_defines(TARGET tfm_non_secure_tests LANGUAGE C DEFINES ENABLE_AUDIT_LOGGING_SERVICE_TESTS APPEND)
endif()
-include(${CMAKE_CURRENT_LIST_DIR}/CMakeLists.inc)
-
if (NOT DEFINED TFM_BUILD_IN_SPE)
message(FATAL_ERROR "TFM_BUILD_IN_SPE is not set. Cannot specify current building status")
endif()
diff --git a/test/TestConfig.cmake b/test/TestConfig.cmake
new file mode 100644
index 0000000..dd9d6f2
--- /dev/null
+++ b/test/TestConfig.cmake
@@ -0,0 +1,14 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2019, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+option(ENABLE_SECURE_STORAGE_SERVICE_TESTS "Option for secure storage service tests" TRUE)
+option(ENABLE_INTERNAL_TRUSTED_STORAGE_SERVICE_TESTS "Option for internal trusted storage services tests" TRUE)
+option(ENABLE_AUDIT_LOGGING_SERVICE_TESTS "Option for audit logging service tests" TRUE)
+option(ENABLE_CRYPTO_SERVICE_TESTS "Option for crypto service tests" TRUE)
+option(ENABLE_ATTESTATION_SERVICE_TESTS "Option for attestation service tests" TRUE)
+option(ENABLE_PLATFORM_SERVICE_TESTS "Option for platform service tests" TRUE)
+option(ENABLE_QCBOR_TESTS "Option for qcbor tests" TRUE)