Test: Secure side tests for the split build

TF-M builds as an external project feeded by TFM_TEST_REPO_PATH.
Having TFM_TEST_REPO_PATH in the build options, main TF-M repo adds
    add_subdirectory(${TFM_TEST_REPO_PATH}/tests)
to include testing compoannent on secure side.

Signed-off-by: Anton Komlev <anton.komlev@arm.com>
Change-Id: Id9c4db3031aa266ff408ac932bd62bbd3d8dd079
diff --git a/app_test_ns/CMakeLists.txt b/app_test_ns/CMakeLists.txt
new file mode 100644
index 0000000..7845d39
--- /dev/null
+++ b/app_test_ns/CMakeLists.txt
@@ -0,0 +1,67 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2023, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+cmake_minimum_required(VERSION 3.15)
+
+if (NOT DEFINED CONFIG_SPE_PATH OR NOT EXISTS ${CONFIG_SPE_PATH})
+    message(FATAL_ERROR "CONFIG_SPE_PATH = ${CONFIG_SPE_PATH} is not defined or incorrect. Please provide full path to TF-M build artifacts using -DCONFIG_SPE_PATH=")
+endif()
+
+if (NOT DEFINED CMAKE_TOOLCHAIN_FILE)
+    set(CROSS_COMPILE         arm-none-eabi)
+    set(CMAKE_TOOLCHAIN_FILE  ${CONFIG_SPE_PATH}/cmake/toolchain_ns_GNUARM.cmake)
+endif()
+
+#--- Test configuration --------------------------------------------------------
+# include(../test/config/default_ns_test_config.cmake)
+# Temporary hardcoded. Need better mechnism of NS tests selectoin
+
+set(TFM_NS_REG_TEST       ON)
+set(NS                    ON)
+set(TEST_NS               ON)
+
+set(TEST_NS_ATTESTATION     OFF        CACHE BOOL      "Whether to build NS regression Attestation tests")
+set(TEST_NS_T_COSE          OFF        CACHE BOOL      "Whether to build NS regression t_cose tests")
+set(TEST_NS_CRYPTO          ON        CACHE BOOL      "Whether to build NS regression Crypto tests")
+set(TEST_NS_ITS             ON        CACHE BOOL      "Whether to build NS regression ITS tests")
+set(TEST_NS_PS              ON        CACHE BOOL      "Whether to build NS regression PS tests")
+set(TEST_NS_PLATFORM        ON        CACHE BOOL      "Whether to build NS regression Platform tests")
+set(TEST_NS_FWU             OFF        CACHE BOOL      "Whether to build NS regression FWU tests")
+set(TEST_NS_MULTI_CORE      OFF        CACHE BOOL      "Whether to build NS regression multi-core tests")
+set(TEST_NS_MANAGE_NSID     OFF        CACHE BOOL      "Whether to build NS regression NSID management tests")
+#------------------------------------------------------------------------------
+
+# Include default test configurations (this not about which test suites to enable or disable)
+include(${CMAKE_CURRENT_LIST_DIR}/test/config/default_test_config.cmake)
+
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../cmake)
+list(APPEND CMAKE_MODULE_PATH ${CONFIG_SPE_PATH}/cmake)
+
+project(tfm_ns LANGUAGES C)
+
+add_executable(tfm_ns)
+
+add_subdirectory(../ns_interface ${CMAKE_BINARY_DIR}/ns_interface)
+add_subdirectory(../test         ${CMAKE_BINARY_DIR}/tests)
+
+############################# TFM NS main app ##################################
+
+target_sources(tfm_ns
+    PRIVATE
+        test_app.c
+)
+
+target_link_libraries(tfm_ns
+    PRIVATE
+        tfm_test_broker
+        tfm_ns_tests
+        tfm_test_framework_common
+)
+
+set_target_properties(tfm_ns PROPERTIES
+    SUFFIX ".axf"
+    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
+)