diff --git a/tests/application_development/software_bill_of_materials/CMakeLists.txt b/tests/application_development/software_bill_of_materials/CMakeLists.txt new file mode 100644 index 00000000000000..90fa8976b91705 --- /dev/null +++ b/tests/application_development/software_bill_of_materials/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2024 Basalte bv +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) + +project(sbom_spdx) +target_sources(app PRIVATE ${ZEPHYR_BASE}/misc/empty_file.c) + +enable_testing() +include(CTest) + +add_test(NAME spdx_gen COMMAND west spdx -d ${CMAKE_BINARY_DIR}) diff --git a/tests/application_development/software_bill_of_materials/PreLoad.cmake b/tests/application_development/software_bill_of_materials/PreLoad.cmake new file mode 100644 index 00000000000000..2691ca6703ae30 --- /dev/null +++ b/tests/application_development/software_bill_of_materials/PreLoad.cmake @@ -0,0 +1,10 @@ +# Copyright (c) 2024 Basalte bv +# SPDX-License-Identifier: Apache-2.0 + +# WARNING: the PreLoad.cmake is an undocumented feature +# We need to create the CMake file API query before the configure step + +execute_process( + COMMAND west spdx --init -d ${CMAKE_BINARY_DIR} + COMMAND_ERROR_IS_FATAL ANY +) diff --git a/tests/application_development/software_bill_of_materials/prj.conf b/tests/application_development/software_bill_of_materials/prj.conf new file mode 100644 index 00000000000000..197106ddf19b4a --- /dev/null +++ b/tests/application_development/software_bill_of_materials/prj.conf @@ -0,0 +1 @@ +CONFIG_BUILD_OUTPUT_META=y diff --git a/tests/application_development/software_bill_of_materials/testcase.yaml b/tests/application_development/software_bill_of_materials/testcase.yaml new file mode 100644 index 00000000000000..75a2247ce51121 --- /dev/null +++ b/tests/application_development/software_bill_of_materials/testcase.yaml @@ -0,0 +1,8 @@ +common: + tags: + - spdx + integration_platforms: + - native_sim + harness: ctest +tests: + sbom.spdx: {}