aboutsummaryrefslogtreecommitdiff
path: root/deployments/component-test
diff options
context:
space:
mode:
Diffstat (limited to 'deployments/component-test')
-rw-r--r--deployments/component-test/arm-linux/CMakeLists.txt34
-rw-r--r--deployments/component-test/component-test.cmake82
-rw-r--r--deployments/component-test/linux-pc/CMakeLists.txt26
3 files changed, 142 insertions, 0 deletions
diff --git a/deployments/component-test/arm-linux/CMakeLists.txt b/deployments/component-test/arm-linux/CMakeLists.txt
new file mode 100644
index 0000000..4b3353c
--- /dev/null
+++ b/deployments/component-test/arm-linux/CMakeLists.txt
@@ -0,0 +1,34 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+cmake_minimum_required(VERSION 3.16)
+include(../../deployment.cmake REQUIRED)
+
+#-------------------------------------------------------------------------------
+# The CMakeLists.txt for building the component-test deployment for arm-linux
+#
+# Used for building and running component level tests as a Linux userspace
+# program running on Arm. Tests can be run by running the built executable
+# called "component-test"
+#-------------------------------------------------------------------------------
+include(${TS_ROOT}/environments/arm-linux/env.cmake)
+project(trusted-services LANGUAGES CXX C)
+add_executable(component-test)
+target_include_directories(component-test PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
+
+#-------------------------------------------------------------------------------
+# Extend with components that are common across all deployments of
+# component-test
+#
+#-------------------------------------------------------------------------------
+include(../component-test.cmake REQUIRED)
+
+#-------------------------------------------------------------------------------
+# Define library options and dependencies.
+#
+#-------------------------------------------------------------------------------
+env_set_link_options(TGT component-test)
+target_link_libraries(component-test PRIVATE stdc++ gcc m)
diff --git a/deployments/component-test/component-test.cmake b/deployments/component-test/component-test.cmake
new file mode 100644
index 0000000..1dc0152
--- /dev/null
+++ b/deployments/component-test/component-test.cmake
@@ -0,0 +1,82 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# The base build file shared between deployments of 'component-test' for
+# different environments. Used for running standalone component tests
+# contained within a single executable.
+#-------------------------------------------------------------------------------
+add_components(
+ TARGET "component-test"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/app/test-runner"
+ "components/app/ts-demo"
+ "components/app/ts-demo/test"
+ "components/common/uuid"
+ "components/common/uuid/test"
+ "components/rpc/common/caller"
+ "components/rpc/common/interface"
+ "components/rpc/direct"
+ "components/rpc/dummy"
+ "components/service/common"
+ "components/service/common/serializer/protobuf"
+ "components/service/common/provider"
+ "components/service/common/provider/test"
+ "components/service/locator"
+ "components/service/locator/interface"
+ "components/service/locator/test"
+ "components/service/locator/standalone"
+ "components/service/locator/standalone/services/crypto"
+ "components/service/crypto/client/cpp"
+ "components/service/crypto/client/test"
+ "components/service/crypto/client/test/standalone"
+ "components/service/crypto/provider/mbedcrypto"
+ "components/service/crypto/provider/mbedcrypto/entropy_source/mock"
+ "components/service/crypto/provider/serializer/protobuf"
+ "components/service/crypto/test/unit"
+ "components/service/crypto/test/service"
+ "components/service/secure_storage/client/psa"
+ "components/service/secure_storage/provider/mock_store"
+ "components/service/secure_storage/provider/secure_flash_store"
+ "components/service/secure_storage/provider/secure_flash_store/flash_fs"
+ "components/service/secure_storage/provider/secure_flash_store/flash"
+ "components/service/secure_storage/test"
+ "protocols/rpc/common/protobuf"
+ "protocols/rpc/common/packed-c"
+ "protocols/rpc/common/packed-c/test"
+ "protocols/service/crypto/packed-c"
+ "protocols/service/crypto/protobuf"
+ "protocols/service/secure_storage/packed-c"
+)
+
+#-------------------------------------------------------------------------------
+# Components used from external projects
+#
+#-------------------------------------------------------------------------------
+
+# CppUTest
+include(${TS_ROOT}/external/CppUTest/CppUTest.cmake)
+target_link_libraries(component-test PRIVATE CppUTest)
+
+# Nanopb
+include(${TS_ROOT}/external/nanopb/nanopb.cmake)
+target_link_libraries(component-test PRIVATE nanopb::protobuf-nanopb-static)
+protobuf_generate_all(TGT "component-test" NAMESPACE "protobuf" BASE_DIR "${TS_ROOT}/protocols")
+
+# Mbedcrypto
+include(${TS_ROOT}/external/mbed-crypto/mbedcrypto.cmake)
+target_link_libraries(component-test PRIVATE mbedcrypto)
+
+#-------------------------------------------------------------------------------
+# Define install content.
+#
+#-------------------------------------------------------------------------------
+if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
+endif()
+install(TARGETS component-test DESTINATION bin) \ No newline at end of file
diff --git a/deployments/component-test/linux-pc/CMakeLists.txt b/deployments/component-test/linux-pc/CMakeLists.txt
new file mode 100644
index 0000000..789bdda
--- /dev/null
+++ b/deployments/component-test/linux-pc/CMakeLists.txt
@@ -0,0 +1,26 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+cmake_minimum_required(VERSION 3.16)
+include(../../deployment.cmake REQUIRED)
+
+#-------------------------------------------------------------------------------
+# The CMakeLists.txt for building the component-test deployment for linux-pc
+#
+# Used for building and running component level tests in a native PC enviroment.
+# Tests can be run by running the built executable called "component-test"
+#-------------------------------------------------------------------------------
+include(${TS_ROOT}/environments/linux-pc/env.cmake)
+project(trusted-services LANGUAGES CXX C)
+add_executable(component-test)
+target_include_directories(component-test PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
+
+#-------------------------------------------------------------------------------
+# Extend with components that are common across all deployments of
+# component-test
+#
+#-------------------------------------------------------------------------------
+include(../component-test.cmake REQUIRED)