testing/drivers: add watchdog notifier cmocka coverage#3639
Conversation
9584062 to
6ec0489
Compare
|
Updated the companion branch in response to the check results:
The test scope and watchdog-only registration behavior are unchanged. |
6ec0489 to
cdd0b1f
Compare
| #if !defined(CONFIG_ARCH_ARMV7A) || !defined(CONFIG_ARCH_HAVE_TRUSTZONE) | ||
| cmocka_unit_test_prestate(drivertest_watchdog_api, &wdg_state) | ||
| cmocka_unit_test_prestate(drivertest_watchdog_api, &wdg_state), | ||
| #endif |
There was a problem hiding this comment.
#endif
#endif
#ifdef CONFIG_WATCHDOG_TIMEOUT_NOTIFIER
cmocka_unit_test_prestate(drivertest_watchdog_notifier, &wdg_state),
cederom
left a comment
There was a problem hiding this comment.
Thank you @Zepp-Hanzj :-)
- You may want to udpate code style or leave as is if you want.
- Please add git commit messages, see https://nuttx.apache.org/docs/latest/contributing/index.html.
|
yeah we can skip this cosmetic part :-)
just a git message and we are ready to go :-)
…--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
|
|
If you are using AI tools, please add the Could you please attach the logs from the tests you ran on sim? |
cdd0b1f to
f1d3688
Compare
|
Addressed the review comments in the latest push. Code updates
The watchdog-only option intentionally skips the other drivertest applications: its purpose is to produce a minimal simulator image that registers only Simulator test logConfiguration: The capture-stop pending-interrupt validation also passed: the callback returned safely after the association was cleared and did not dereference a NULL upper-half. |
f1d3688 to
8fa68e9
Compare
|
The checkpatch failure was caused by commit messages shorter than the repository minimum of five lines. Both commits now include a descriptive body, the requested |
|
The simulator build exposed and is now fixed in commit |
Assisted-by: OpenAI Codex |
|
Thanks @cederom. Agreed — the remaining cosmetic formatting discussion can be skipped. The required commit messages are now in place with both |
|
The failed CI jobs were investigated. The root cause was the CMake condition in Fixed in commit
|
There was a problem hiding this comment.
@Zepp-Hanzj please add Documentation to drivertest to https://nuttx.apache.org/docs/latest/applications/testing/drivertest/index.html since the original author didn't add it and in the past we didn't required Documentation for new features
Please explain what is drivertest and which kind of tests are executed currently
|
Thanks. I expanded the drivertest documentation to explain what the test collection is, how its applications are selected and run, the current test categories, and the watchdog reset/notifier cases. The documentation source is in the main NuttX repository, so the change is in the companion NuttX PR #19433, commit I also verified the complete documentation tree with Sphinx using |
f26a62d to
7abf319
Compare
Extend the watchdog drivertest with notifier ordering, duplicate registration, repeated delivery, unregister, NULL-data, and concurrent registration coverage. Register the watchdog test when either reset-cause or timeout-notifier support is available. Keep hardware watchdog cases gated by reset-cause support and allow notifier-only simulator builds through both Make and CMake. Keep test state in the watchdog fixture and notifier blocks so callbacks do not depend on shared notifier state. Assisted-by: OpenAI Codex Signed-off-by: hanzhijian <hanzhijian@zepp.com>
7abf319 to
cbddb03
Compare
Summary
Add focused cmocka coverage for the watchdog timeout notifier chain and allow the watchdog drivertest to run notifier-only coverage on configurations without reset-cause support.
Changes
cmocka_driver_watchdogwhen watchdog support is enabled together with either reset-cause support or timeout-notifier support.CONFIG_BOARDCTL_RESET_CAUSEand the notifier cases only withCONFIG_WATCHDOG_TIMEOUT_NOTIFIER.WATCHDOG_NOTIFIER_ACTIONpropagation;data == NULLpropagation;Validation
The test was run using the companion NuttX simulator configuration. Since that configuration enables timeout-notifier support without reset-cause support,
cmocka_driver_watchdogruns only the two notifier cases:Both the Make and CMake registration paths compile
cmocka_driver_watchdogfor this configuration. The race test repeatedly interleaves timeout delivery with notifier registration and unregistration and asserts that callbacks remain valid and receive aNULLpayload.Additional hardware-path validation was performed in the companion NuttX PR on STM32F407 WWDG hardware. The corresponding UART logs and screenshots are linked there:
Scope
This PR contains only watchdog notifier tests and their test registration. Unrelated
O_RDONLYcompatibility changes are intentionally excluded.Merge order
Merge the companion NuttX core PR first, then enable this test configuration in CI or simulator validation.
Checklist
git diff --checkand NuttXcheckpatch.shpass.