1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:52:44 +01:00

tests/README.md: add paragraph explaining expect()

This commit is contained in:
Kaspar Schleiser 2020-02-11 16:48:06 +01:00
parent fc0ac42ba1
commit 981cdeaa47

View File

@ -85,6 +85,17 @@ pattern like `\r\n`, `\s`, `\)`, etc..
child.expect(r'some string: (\d+) ,')
~~~
Use expect() instead of assert()
--------------------------------
In order to make a test application functional in all cases, use `expect()`
instead of `assert()`. The former works like the latter, but will still be
compiled in if `NDEBUG` is defined. This is useful to keep a test application
working even when compiling with -DNDEBUG, allowing for the code-under-test to
be compiled with that flag. Otherwise, the application would force compiling
all tested code with assertions enabled.
`expect()` is defined in the header `test_utils/expect.h`.
Interaction through the uart
----------------------------