Skip to content

Commit

Permalink
tests: application_development: Add spdx SBOM test
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
pdgendt committed Jan 10, 2025
1 parent c182817 commit 35b4ded
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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})
Original file line number Diff line number Diff line change
@@ -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
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_BUILD_OUTPUT_META=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
common:
tags:
- spdx
integration_platforms:
- native_sim
harness: ctest
tests:
sbom.spdx: {}

0 comments on commit 35b4ded

Please sign in to comment.