Closed str4d closed 1 year ago
Ideally the test harness would make it easy to write normal Rust tests that Just Work.™️ What I'm imagining is something like this:
#[device_test]
or something to trigger the harness.
I also have a ST-Link USB dongle around somewhere which could be used to catch crashes with the in-circuit debugging feature.
It may also be worth looking at something like QEMU (as mentioned in The Embedded Rust Book) for running some tests, at least the ones which don't access periphery (screen, GPIO, iButton, etc). This would probably allow running these tests on CI.
Also to add to the list os useful links:
Okay, #57 now implements on-device unit and integration tests with the kind of usability I was aiming for.
I'm traveling overseas this week, but should be able to take a look in the evening.
Currently all testing facilities are disabled for the crates in this repo. It makes sense because everything will only run on an actual Flipper Zero, but it does make verification of things tricky.
It would be useful to have a test harness, that runs the test binaries on a connected Flipper Zero. I'm imagining something like the integration tests for the
yubikey
crate, which require setting aYUBIKEY_SERIAL
environment variable in order to run. Thetest-with
crate might also be helpful here, specifically#[test_with::env(FLIPPER_ZERO_SERIAL_PORT)]
or something, that can be used to enable at compilation time tests that require a connected Flipper Zero.