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
* bump defmt to v0.3
remove Cargo features which are no longer needed
* remove `timestamp!`
it's no longer mandatory and a monotonic counter does not add much value given that `defmt-rtt`
works by disabling interrupts so one won't see logs out of order anyways (which would the case for a
lock-free multi-channel `Logger`)
* use println! in most the examples
so that all examples print something when `DEFMT_LOG` is unset
* make overflow example terminate in less steps
also include an estimate of the stack pointer to show the stack grows downwards towards the RAM
boundary
Without this change, if `testsuite/src/lib.rs` will be crated and `cargo
test` is invoked, cargo will try to link libtest with the crate.
As this crate is `no_std` and will usually be run for targets, where no
std library exists and therefor also no libtest, this will fail with an
error similar to this:
error[E0463]: can't find crate for `test`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error: could not compile `testsuite`
To circumvent this issue, disable the harness for lib as well.
Because the crates lib.rs is handled as a binary for test mode,
rust will look for a main function.
Add a minimal lib.rs, so that it will compile and run, when
test is invoked.
Cargo doc says:
> Note that when using the cargo test and cargo bench commands, the test/bench profiles only apply to the final test executable. Dependencies will continue to use the dev/release profiles.
So with the current settings, `cargo test` optimizes all dependencies but not the top level
crate (e.g. `test/foo.rs`)
This commit adds optimizations to the last `rustc` invocation of `cargo test`. This results in a 6%
reduction in binary size when doing `cargo test` on our sample test file.