Skip to content

Commit 5d23996

Browse files
pdgendtkartben
authored andcommitted
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 <[email protected]>
1 parent 1378669 commit 5d23996

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2024 Basalte bv
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
cmake_minimum_required(VERSION 3.20.0)
5+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
6+
7+
project(sbom_spdx)
8+
target_sources(app PRIVATE ${ZEPHYR_BASE}/misc/empty_file.c)
9+
10+
enable_testing()
11+
include(CTest)
12+
13+
add_test(NAME spdx_gen COMMAND west spdx -d ${CMAKE_BINARY_DIR})
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2024 Basalte bv
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# WARNING: the PreLoad.cmake is an undocumented feature
5+
# We need to create the CMake file API query before the configure step
6+
7+
execute_process(
8+
COMMAND west spdx --init -d ${CMAKE_BINARY_DIR}
9+
COMMAND_ERROR_IS_FATAL ANY
10+
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_BUILD_OUTPUT_META=y
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
common:
2+
tags:
3+
- spdx
4+
integration_platforms:
5+
- native_sim
6+
harness: ctest
7+
tests:
8+
sbom.spdx: {}

0 commit comments

Comments
 (0)