Commit graph

10 commits

Author SHA1 Message Date
Yuval Peress
ba9b4f3734 ztest: Fix confusing SKIP log
When CONFIG_ZTEST_FAIL_ON_ASSUME is set, a failed assumption will
cause the suite to fail, but the individual test will be marked as
SKIPPED. We should fail the test so it's clear what's going on.

Fixes #86611

Signed-off-by: Yuval Peress <peress@google.com>
2025-04-04 21:16:34 +02:00
Alberto Escolar Piedras
28edb220cd 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>
2024-10-25 18:51:10 +01:00
Alberto Escolar Piedras
99d7161e34 tests/ztest/fail: fix board name
Use full board name in cmake file.
Akin to the fix done in
https://github.com/zephyrproject-rtos/zephyr/pull/80270/
following the changes from
https://github.com/zephyrproject-rtos/zephyr/pull/77250/

Note after the Zephyr cmake code has been run the BOARD
variable is split into BOARD BOARD_QUALIFIERS,
where BOARD does not contain the qualifiers anymore
(see cmake/modules/boards.cmake for more info).

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-10-25 18:51:10 +01:00
Torsten Rasmussen
e8e5169f95 cmake: remove the use of SOURCES in tests
Setting SOURCES before calling find_package() was deprecated in #51049.

Cleanup usage of SOURCES and instead use the proper target_sources()
CMake function.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-08-05 16:27:09 +02:00
Alberto Escolar Piedras
0b3a7bc7d4 tests/ztest/fail: Fix build for native_sim
The final executable output from the native_sim
(or native_posix) build is zephyr.exe
(in native_posix zephyr.elf happened to be just a copy of
the exe, but in native_sim it is an intermediate build step)

So we need to use the exe instead.

Note: As the exe is generated with a custom target, we need
to install it using install(FILES), which also requires the
destination and permissions to be listed manually. The
permissions set are just the cmake default permissions
for install(PROGRAMS).

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 12:02:48 +01:00
Anas Nashif
345735d0a8 tests: remove CONFIG_ZTEST_NEW_API in all tests
Remove all usage of CONFIG_ZTEST_NEW_API from tests and sample as this
is now enabled by default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-20 15:04:29 +02:00
Stephanos Ioannidis
cf211aa7af treewide: Update deprecated CONFIG_LIB_CPLUSPLUS usages
This commit updates all deprecated `CONFIG_LIB_CPLUSPLUS` usages to:

* check if the Zephyr minimal C++ library is enabled using
  `CONFIG_MINIMAL_LIBCPP` instead of relying on the
  `CONFIG_LIB_CPLUSPLUS`-based inference.

* select `CONFIG_REQUIRES_FULL_LIBCPP` when there exists a component-
  level C++ standard library dependency. This allows a component to
  declare C++ standard library dependency without designating a
  specific libray implementation.

* select the correct type of C++ standard library implementation to use
  through one of the `CONFIG_LIBCPP_IMPLEMENTATION` choices.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-01-13 17:42:55 -05:00
Stephanos Ioannidis
4a64bfe351 treewide: Use CONFIG_CPP instead of CONFIG_CPLUSPLUS
This commit updates all in-tree code to use `CONFIG_CPP` instead of
`CONFIG_CPLUSPLUS`, which is now deprecated.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-01-13 17:42:55 -05:00
Yuval Peress
dbd63e8008 ztest: add tests for failing on zassume
Add a test to make sure that when a zassume fails, we mark the test
as failed and print an "Assumption failed" error for the test

Signed-off-by: Yuval Peress <peress@google.com>
2022-10-13 06:40:31 -04:00
Yuval Peress
7187d8b7fc ztest: add framework tests for failed states
Add specialized tests that execute another test indirectly and ensure
that the results report errors correctly. See the README.rst file
provided with this commit for details.

Signed-off-by: Yuval Peress <peress@google.com>
2022-08-29 10:27:00 +02:00