Skip to content

Commit be9fab7

Browse files
committed
Convert to new Zephyr Test Framework
Zephyr 3.2 provides new API for ZTEST. Also adopt the new header file location. Since Zephyr 3.1, all public interfaces are moved under <zerphyr/...> Signed-off-by: Yasushi SHOJI <[email protected]>
1 parent c402c4a commit be9fab7

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

prj.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
CONFIG_ZTEST=y
2+
CONFIG_ZTEST_NEW_API=y

src/main.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#include <ztest.h>
7+
#include <zephyr/ztest.h>
88

9-
static void test_assert(void)
9+
ZTEST(simple, simple_asert)
1010
{
1111
zassert_true(1, "1 was false");
1212
zassert_false(0, "0 was true");
@@ -16,10 +16,4 @@ static void test_assert(void)
1616
zassert_equal_ptr(NULL, NULL, "NULL was not equal to NULL");
1717
}
1818

19-
void test_main(void)
20-
{
21-
ztest_test_suite(tests,
22-
ztest_unit_test(test_assert));
23-
24-
ztest_run_test_suite(tests);
25-
}
19+
ZTEST_SUITE(simple, NULL, NULL, NULL, NULL, NULL);

0 commit comments

Comments
 (0)