Skip to content

Commit 28edb22

Browse files
aescolardleach02
authored andcommitted
tests: Support targeting unit_testing with and without qualifier
For tests that support both targeting unit_testing and other targets, we check in the cmake code the BOARD variable. Let's allow users to set this to either of unit_testing or unit_testing/unit_testing so it behaves like for other tests. Signed-off-by: Alberto Escolar Piedras <[email protected]>
1 parent 9ceeb9b commit 28edb22

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

tests/subsys/testsuite/fff_fake_contexts/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
cmake_minimum_required(VERSION 3.20.0)
5-
if(BOARD STREQUAL unit_testing/unit_testing)
5+
if(BOARD STREQUAL "unit_testing" OR BOARD STREQUAL "unit_testing/unit_testing")
66
find_package(Zephyr COMPONENTS unittest REQUIRED HINTS $ENV{ZEPHYR_BASE})
77
set(target testbinary)
88
else()

tests/ztest/base/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: Apache-2.0
22

33
cmake_minimum_required(VERSION 3.20.0)
4-
if(BOARD STREQUAL unit_testing/unit_testing)
4+
if(BOARD STREQUAL "unit_testing" OR BOARD STREQUAL "unit_testing/unit_testing")
55
find_package(Zephyr COMPONENTS unittest REQUIRED HINTS $ENV{ZEPHYR_BASE})
66
project(base)
77

tests/ztest/fail/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
cmake_minimum_required(VERSION 3.20.0)
55
include(ExternalProject)
66

7-
if(BOARD STREQUAL unit_testing/unit_testing)
7+
if(BOARD STREQUAL "unit_testing" OR BOARD STREQUAL "unit_testing/unit_testing")
88
find_package(Zephyr COMPONENTS unittest REQUIRED HINTS $ENV{ZEPHYR_BASE})
99
set(target testbinary)
1010
# Set the target binary for the 'core' external project. The path to this must match the one set

tests/ztest/fail/core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ elseif(CONFIG_ZTEST_FAIL_TEST_UNEXPECTED_ASSUME)
2323
list(APPEND test_sources src/unexpected_assume.cpp)
2424
endif()
2525

26-
if(BOARD STREQUAL unit_testing/unit_testing)
26+
if(BOARD STREQUAL "unit_testing" OR BOARD STREQUAL "unit_testing/unit_testing")
2727
find_package(Zephyr COMPONENTS unittest REQUIRED HINTS $ENV{ZEPHYR_BASE})
2828
project(base)
2929

tests/ztest/zexpect/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: Apache-2.0
22

33
cmake_minimum_required(VERSION 3.20.0)
4-
if(BOARD STREQUAL unit_testing/unit_testing)
4+
if(BOARD STREQUAL "unit_testing" OR BOARD STREQUAL "unit_testing/unit_testing")
55
find_package(Zephyr COMPONENTS unittest REQUIRED HINTS $ENV{ZEPHYR_BASE})
66
project(base)
77

0 commit comments

Comments
 (0)