add unit tests (#60)
also, flatten the workspace into a single crate. I forget what the original reason for the workspace was -- I think it was added because `cargo t -p testsuite` is nicer than running `cargo t --test $filename` N times. However, a single crate removes the need to repeat the list of dependencies in `testsuite/Cargo.toml` also, document the two sets of tests included with the template and how to run them in the README file
This commit is contained in:
+15
@@ -1,3 +1,4 @@
|
||||
#![no_main]
|
||||
#![no_std]
|
||||
|
||||
use defmt_rtt as _; // global logger
|
||||
@@ -20,3 +21,17 @@ pub fn exit() -> ! {
|
||||
cortex_m::asm::bkpt();
|
||||
}
|
||||
}
|
||||
|
||||
// defmt-test 0.3.0 has the limitation that this `#[tests]` attribute can only be used
|
||||
// once within a crate. the module can be in any file but there can only be at most
|
||||
// one `#[tests]` module in this library crate
|
||||
#[cfg(test)]
|
||||
#[defmt_test::tests]
|
||||
mod unit_tests {
|
||||
use defmt::assert;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
assert!(true)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user