tests: application_development: Add spdx SBOM test

Add a test where the software bill of materials is generated using the
west spdx extension.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
Pieter De Gendt 2024-12-24 15:01:21 +01:00 committed by Benjamin Cabé
commit 5d23996361
4 changed files with 32 additions and 0 deletions

View file

@ -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})

View file

@ -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
)

View file

@ -0,0 +1 @@
CONFIG_BUILD_OUTPUT_META=y

View file

@ -0,0 +1,8 @@
common:
tags:
- spdx
integration_platforms:
- native_sim
harness: ctest
tests:
sbom.spdx: {}