Browse Source

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 <alberto.escolar.piedras@nordicsemi.no>
pull/79130/merge
Alberto Escolar Piedras 9 months ago committed by David Leach
parent
commit
28edb220cd
  1. 2
      tests/subsys/testsuite/fff_fake_contexts/CMakeLists.txt
  2. 2
      tests/ztest/base/CMakeLists.txt
  3. 2
      tests/ztest/fail/CMakeLists.txt
  4. 2
      tests/ztest/fail/core/CMakeLists.txt
  5. 2
      tests/ztest/zexpect/CMakeLists.txt

2
tests/subsys/testsuite/fff_fake_contexts/CMakeLists.txt

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.20.0)
if(BOARD STREQUAL unit_testing/unit_testing)
if(BOARD STREQUAL "unit_testing" OR BOARD STREQUAL "unit_testing/unit_testing")
find_package(Zephyr COMPONENTS unittest REQUIRED HINTS $ENV{ZEPHYR_BASE})
set(target testbinary)
else()

2
tests/ztest/base/CMakeLists.txt

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.20.0)
if(BOARD STREQUAL unit_testing/unit_testing)
if(BOARD STREQUAL "unit_testing" OR BOARD STREQUAL "unit_testing/unit_testing")
find_package(Zephyr COMPONENTS unittest REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(base)

2
tests/ztest/fail/CMakeLists.txt

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
cmake_minimum_required(VERSION 3.20.0)
include(ExternalProject)
if(BOARD STREQUAL unit_testing/unit_testing)
if(BOARD STREQUAL "unit_testing" OR BOARD STREQUAL "unit_testing/unit_testing")
find_package(Zephyr COMPONENTS unittest REQUIRED HINTS $ENV{ZEPHYR_BASE})
set(target testbinary)
# Set the target binary for the 'core' external project. The path to this must match the one set

2
tests/ztest/fail/core/CMakeLists.txt

@ -23,7 +23,7 @@ elseif(CONFIG_ZTEST_FAIL_TEST_UNEXPECTED_ASSUME) @@ -23,7 +23,7 @@ elseif(CONFIG_ZTEST_FAIL_TEST_UNEXPECTED_ASSUME)
list(APPEND test_sources src/unexpected_assume.cpp)
endif()
if(BOARD STREQUAL unit_testing/unit_testing)
if(BOARD STREQUAL "unit_testing" OR BOARD STREQUAL "unit_testing/unit_testing")
find_package(Zephyr COMPONENTS unittest REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(base)

2
tests/ztest/zexpect/CMakeLists.txt

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.20.0)
if(BOARD STREQUAL unit_testing/unit_testing)
if(BOARD STREQUAL "unit_testing" OR BOARD STREQUAL "unit_testing/unit_testing")
find_package(Zephyr COMPONENTS unittest REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(base)

Loading…
Cancel
Save