We cannot use the D0/D1 UART if it is also used for STDIO. However,
the logic did not take into account whether `stdio_uart` was used at
all. This fixes the issue.
Calling `uart_poweroff()` when done with the UART test allows sharing
the underlying hardware e.g. to provide other peripheral interfaces.
One example of this would be the SERCOM3 on the Adafruit Metro M4
Express that is used to provide UART on D1/D0 and SPI on D11/D12/D13.
This is no longer a warning but an error.
Also: This is already covered by the static tests via
`dist/tools/feature_resolution/check.sh`, which uses a lot less CPU
time in the CI.
The GPIO IRQ tests had a side-effect that IRQs remained configured after
the test case was complete. This caused stray IRQs to trigger on
SAM0 MCUs and they consequently (and incorrectly) failed the test.
Calling `timer_init()` with unsupported frequencies on some MCUs just
selects the closest possible frequency. But e.g. on SAM0, using an
unsupported frequency will cause `timer_init()` to fail; which probably
is the better option.
However, a failing calling to `timer_init()` results in a test failure.
This is now worked around by using timer_query_freq() to select a
suitable timer frequency that is supported.
Use `test_utils_interactive_sync` for the following tests explicitly:
- tests/periph/timer_periodic
- tests/sys/posix_sleep
This is needed for accurate timestamping of the stdio received. The
tests will not pass without on `native` / `native64`.
This increases the robustness of the test by not relying on the
order shell commands are printed in. At least for XFA based shell
commands, there is no guarantee in which order they will be shown in
the help.
The test following test is flaky:
TEST_ASSERT(msg->send_time > 0U);
It assumes that 0 as time is indicating the time is invalid. But on
`native`, the time will be zero for the first millisecond the test
is launched. Before the interactive sync caused seemingly a reliable
delay of at least one milli second, but this no longer is the case.
This works around the bug by just waiting at the start of the test
until the time is no longer zero, possibly spinning for one millisecond.
The aim is to allow faster test cycles on native for unit test style
apps (that don't need interaction) by bypassing the python test
framework using e.g.:
make RIOT_TERMINAL=native all term
This would work already before, but now is more convenient as no
manual press of the `s` key is needed to start the test.
For non-native boards we need the sync, as otherwise the board may
finish booting before the python test automation framework can capture
output. For `native` and `native64`, we actually control when the RIOT
app is started and do not need to sync.
On a typical machine this can reduce the test cycle by more than 4
seconds.
With this change:
$ time sh -c 'make BOARD=native -C tests/unittests tests-nanocoap -j && make BOARD=native RIOT_TERMINAL=native -C tests/unittests term'
[...]
main(): This is RIOT! (Version: 2024.10-devel-394-gd65dec-tests/no-sync-control)
...................................
OK (35 tests)
[...]
make: Leaving directory '/home/marian.buschsieweke@ml-pa.loc/Repos/software/RIOT/master/tests/unittests'
sh -c 0.30s user 0.24s system 113% cpu 0.476 total
Before t his change:
$ time sh -c 'make BOARD=native -C tests/unittests tests-nanocoap -j && make BOARD=native -C tests/unittests test'
[...]
main(): This is RIOT! (Version: 2024.10-devel-394-gd65dec-tests/no-sync-control)
Help: Press s to start test, r to print it is ready
READY
s
START
...................................
OK (35 tests)
[...]
make: Leaving directory '/home/marian.buschsieweke@ml-pa.loc/Repos/software/RIOT/master/tests/unittests'
sh -c 0.50s user 0.37s system 17% cpu 4.863 total
This changes the API of xfa from
XFA(array_name, prio) type element_name = INITIALIZER;
to
XFA(type, array_name, prio) element_name = INITIALIZER;
this allows forcing natural alignment of the type, fixing failing tests
on `native64`.
Before the test used the `help` command to verify that access to the
shell is present. While this does have the benefit of not requiring a
custom command, it does have some robustness issues:
- When new default commands get added, this test will fail
- When the help message of a command gets reworded, the test will fail
- When the order of commands in the test will change, the test will fail
- Note that with the XFA based `SHELL_COMMAND()` macro, we do not
guarantee any particular order. Specifically, the order can change
with implementation details.
This increases the test coverage for XFA:
- Multiple entries are added from a single file
- Priorities are assigned to enforce a given order
- The size of the `struct` to add is changed to no longer be a power of
2
This increases test coverage for coap_build_reply_header() for the case
that extended tokens are used. The test validates the correctness of
the return value and the correctness of the assembled reply.
Previously the corner case when RFC 8974 extended TKL fields are used
the result of coap_get_totel_hdr_len() was not tested, resulting in a
bug slipping through the test. This increase the test coverage.