Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
e4dae09
Update ztest with more powerful testing APIs
Oct 20, 2021
7414e29
tests: app_dev: gen_inc_file: Update tests to use new ztest APIs
Nov 10, 2021
cb9f83b
tests: dlist_perf: Update to use new ztest APIs
Nov 10, 2021
48a97c3
tests: rbtree_perf: Update to use new ztest APIs
Nov 10, 2021
135e8e8
tests: msgq_api: Update to use new ztest APIs
Nov 10, 2021
2f589ba
test: msgq_usage: Update to new ztest APIs
Nov 10, 2021
762f1e1
test: mutex_api: Update to use new ztest APIs
Nov 10, 2021
08054ab
tests: sys_mutex: Update to use new ztest APIs
Nov 10, 2021
60923f5
tests: pipe: Update to use new ztest APIs
Nov 10, 2021
7b63b4e
tests: pipe: Update to use new ztest APIs
Nov 10, 2021
2cb7376
tests: pipe_api: Update to new ztest APIs
Nov 10, 2021
53ec3d0
tests: fifo_usage: Update to new ztest APIs
Nov 10, 2021
c1f193b
tests: fifo_timeout: Update to new ztest APIs
Nov 10, 2021
815fd66
tests: fifo_api: Update to new ztest APIs
Nov 10, 2021
aa78678
tests: arm_hardfault_validation: ztest refactor
aaronemassey Nov 10, 2021
fd15fd1
tests: arm_interrupt: Refactor to new ztest API
aaronemassey Nov 10, 2021
a16b33e
test: arm_irq_advanced_features: update to new api
aaronemassey Nov 10, 2021
1e7f076
tests: arm_irq_vector_table: refactor to new api
aaronemassey Nov 10, 2021
c62d431
tests: arm_mem_protect: Update to new ZTEST api
aaronemassey Nov 10, 2021
8bef102
tests: arm_ramfunc: Update to new ztest api
aaronemassey Nov 10, 2021
0a79be2
tests: arm_runtime_nmi: update to new ztest api
aaronemassey Nov 11, 2021
bef8209
tests: arm_sw_vector_relay: update ztest apie use
aaronemassey Nov 11, 2021
7a76928
tests: arm_thread_swap_tz: update to new ztest api
aaronemassey Nov 11, 2021
6b3897b
tests: arm_thread_swap: update use of ztest API
aaronemassey Nov 11, 2021
1f328f0
tests: arm_tz_wrap_func: update to new ztest API
aaronemassey Nov 11, 2021
17f8a5c
tests: basicmath: update to new ZTEST APIs
aaronemassey Nov 11, 2021
859818f
tests: arm64_gicv3_its: update to new ztest API
aaronemassey Nov 11, 2021
eb47a08
tests: cpu_scrubs_regs: update to new ztest apis
aaronemassey Nov 11, 2021
6795e21
tests: nmi: update to use new ZTEST APIs
aaronemassey Nov 11, 2021
897713f
tests: pagetables: update to use new ZTEST APIs
aaronemassey Nov 11, 2021
070b2aa
tests: static_idt: update to use new ZTEST APIs
aaronemassey Nov 11, 2021
7aa4807
tests: mbedtls: update to new ZTEST APIs
aaronemassey Nov 12, 2021
d17471c
tests: rand32: update to new ZTEST APIs
aaronemassey Nov 12, 2021
48ff23c
tests: tinycrypt_hmac_prng: update ZTEST APIs
aaronemassey Nov 12, 2021
bd120f7
tests: tinycrypt: update to new ZTEST APIs
aaronemassey Nov 12, 2021
9ac75ce
tests/bluetooth/adv/src/main.c
tristan-google Nov 11, 2021
8f976b0
zephyr/tests/bluetooth/at/src/main.c
tristan-google Nov 11, 2021
7bc04ba
zephyr/tests/bluetooth/bluetooth/src/bluetooth.c
tristan-google Nov 11, 2021
736ca5b
zephyr/tests/bluetooth/ctrl_sw_privacy/src/main.c
tristan-google Nov 11, 2021
7fa7173
zephyr/tests/bluetooth/ctrl_sw_privacy_unit/src/main.c
tristan-google Nov 11, 2021
046dd99
zephyr/tests/bluetooth/ctrl_user_ext/src/main.c
tristan-google Nov 11, 2021
3761b6a
zephyr/tests/bluetooth/df/connection_cte_req
tristan-google Nov 12, 2021
e58039f
zephyr/tests/bluetooth/df/connectionless_cte_chains
tristan-google Nov 12, 2021
6753a03
zephyr/tests/bluetooth/df/connectionless_cte_rx
tristan-google Nov 12, 2021
2594bfe
zephyr/tests/bluetooth/df/connectionless_cte_tx
tristan-google Nov 12, 2021
31227d5
zephyr/tests/bluetooth/gatt
tristan-google Nov 12, 2021
da67ded
zephyr/tests/bluetooth/hci_codecs_info
tristan-google Nov 15, 2021
8a7f163
zephyr/tests/bluetooth/hci_prop_evt
tristan-google Nov 15, 2021
7c40790
zephyr/tests/bluetooth/init
tristan-google Nov 15, 2021
03d20e2
zephyr/tests/bluetooth/l2cap
tristan-google Nov 15, 2021
8690287
tests/bluetooth/ll_settings
tristan-google Nov 15, 2021
c2542d4
tests/bluetooth/uuid
tristan-google Nov 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/linker/common-ram.ld
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,6 @@

#if defined(CONFIG_ZTEST)
ITERABLE_SECTION_RAM(ztest_suite_node, 4)
ITERABLE_SECTION_RAM(ztest_unit_test, 4)
ITERABLE_SECTION_RAM(ztest_test_rule, 4)
#endif /* CONFIG_ZTEST */
14 changes: 4 additions & 10 deletions samples/subsys/testsuite/integration/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@

#include <ztest.h>


ZTEST_SUITE(framework_tests, NULL, NULL, NULL, NULL, NULL);

/**
* @brief Test Asserts
*
* This test verifies various assert macros provided by ztest.
*
*/
static void test_assert(void)
ZTEST(framework_tests, test_assert)
{
zassert_true(1, "1 was false");
zassert_false(0, "0 was true");
Expand All @@ -21,12 +24,3 @@ static void test_assert(void)
zassert_equal(1, 1, "1 was not equal to 1");
zassert_equal_ptr(NULL, NULL, "NULL was not equal to NULL");
}

void test_main(void)
{
ztest_test_suite(framework_tests,
ztest_unit_test(test_assert)
);

ztest_run_test_suite(framework_tests);
}
14 changes: 4 additions & 10 deletions samples/subsys/testsuite/pytest/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <ztest.h>
void test_pytest(void)
{
TC_PRINT("Hello world\n");
}

void test_main(void)
{
ztest_test_suite(test_pytest,
ztest_unit_test(test_pytest)
);
ZTEST_SUITE(test_pytest, NULL, NULL, NULL, NULL, NULL);

ztest_run_test_suite(test_pytest);
ZTEST(test_pytest, test_pytest)
{
TC_PRINT("Hello world\n");
}
1 change: 1 addition & 0 deletions subsys/bluetooth/controller/ll_sw/ull_chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "lll/lll_adv_types.h"
#include "lll_adv.h"
#include "lll/lll_adv_pdu.h"
#include "lll/lll_df_types.h"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a modification I had to make to a non-UT source file in order to get it to build (it was missing a struct declaration otherwise)

#include "lll_conn.h"

#include "ull_adv_types.h"
Expand Down
12 changes: 12 additions & 0 deletions subsys/testsuite/include/ztest.ld
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,17 @@ SECTIONS
KEEP(*(SORT_BY_NAME(._ztest_suite_node.static.*)))
_ztest_suite_node_list_end = .;
}
.data.ztest_unit_test_area : ALIGN(4)
{
_ztest_unit_test_list_start = .;
KEEP(*(SORT_BY_NAME(._ztest_unit_test.static.*)))
_ztest_unit_test_list_end = .;
}
.data.ztest_test_rule_area : ALIGN(4)
{
_ztest_test_rule_list_start = .;
KEEP(*(SORT_BY_NAME(._ztest_test_rule.static.*)))
_ztest_test_rule_list_end = .;
}
}
INSERT AFTER .data;
1 change: 1 addition & 0 deletions subsys/testsuite/ztest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ zephyr_include_directories(
zephyr_library()
zephyr_library_sources( src/ztest.c)
zephyr_library_sources( src/ztest_error_hook.c)
zephyr_library_sources( src/ztest_rules.c)
zephyr_library_sources_ifdef(CONFIG_ZTEST_MOCKING src/ztest_mock.c)
10 changes: 10 additions & 0 deletions subsys/testsuite/ztest/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ config ZTEST_ASSERT_HOOK
error test case. Remember to add ignore_fault tag in yaml file when
using twister to run testing.

menu "ztest provided rules"

config ZTEST_RULE_1CPU
bool "Run all the tests on a single CPU"
help
This rule will call z_test_1cpu_start before each unit test and
ztest_1cpu_stop after each test.

endmenu

endif # ZTEST

config ZTEST_MOCKING
Expand Down
Loading