Skip to content

Commit cceb3e4

Browse files
aaronemasseynashif
authored andcommitted
tests: wdt_basic_api: update to new ZTEST APIs
Update test suite to leverage new ZTEST APIs. TEST=twister -T tests/drivers/watchdog/wdt_basic_api # Only build Signed-off-by: Aaron Massey <[email protected]>
1 parent d970724 commit cceb3e4

File tree

4 files changed

+3
-29
lines changed

4 files changed

+3
-29
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
CONFIG_WATCHDOG=y
22
CONFIG_WDT_DISABLE_AT_BOOT=n
33
CONFIG_ZTEST=y
4+
CONFIG_ZTEST_NEW_API=y
45
CONFIG_BOOT_BANNER=n

tests/drivers/watchdog/wdt_basic_api/src/main.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,5 @@
1414

1515
#include <zephyr/zephyr.h>
1616
#include <ztest.h>
17-
#include "test_wdt.h"
1817

19-
20-
void test_main(void)
21-
{
22-
ztest_test_suite(wdt_basic_test,
23-
ztest_unit_test(test_wdt));
24-
ztest_run_test_suite(wdt_basic_test);
25-
}
18+
ZTEST_SUITE(wdt_basic_test_suite, NULL, NULL, NULL, NULL, NULL);

tests/drivers/watchdog/wdt_basic_api/src/test_wdt.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
#include <zephyr/drivers/watchdog.h>
6161
#include <zephyr/zephyr.h>
6262
#include <ztest.h>
63-
#include "test_wdt.h"
6463

6564
/*
6665
* To use this test, either the devicetree's /aliases must have a
@@ -356,7 +355,7 @@ static int test_wdt_bad_window_max(void)
356355
return TC_FAIL;
357356
}
358357

359-
void test_wdt(void)
358+
ZTEST(wdt_basic_test_suite, test_wdt)
360359
{
361360
if ((m_testcase_index != 1U) && (m_testcase_index != 2U)) {
362361
zassert_true(test_wdt_no_callback() == TC_PASS, NULL);

tests/drivers/watchdog/wdt_basic_api/src/test_wdt.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)