Add an on-device test suite

This commit is contained in:
Jonas Schievink
2020-08-31 18:20:48 +02:00
parent 8650c1f517
commit 01ecb349d0
3 changed files with 64 additions and 0 deletions
+6
View File
@@ -5,6 +5,12 @@ name = "{{project-name}}"
edition = "2018" edition = "2018"
version = "0.1.0" version = "0.1.0"
[lib]
test = false
[workspace]
members = ["testsuite"]
[dependencies.defmt] [dependencies.defmt]
git = "https://github.com/knurling-rs/defmt" git = "https://github.com/knurling-rs/defmt"
branch = "main" branch = "main"
+46
View File
@@ -0,0 +1,46 @@
[package]
# TODO(1) fix `authors` if you didn't use `cargo-generate`
authors = ["{{authors}}"]
name = "testsuite"
publish = false
edition = "2018"
version = "0.1.0"
[[test]]
name = "test"
harness = false
[dependencies.defmt]
git = "https://github.com/knurling-rs/defmt"
branch = "main"
[dependencies.defmt-rtt]
git = "https://github.com/knurling-rs/defmt"
branch = "main"
[dependencies.panic-probe]
git = "https://github.com/knurling-rs/probe-run"
branch = "main"
# enable the `print-defmt` feature for more complete test output
features = ["print-defmt"]
[dependencies]
{{project-name}} = { path = ".." }
cortex-m = "0.6.3"
cortex-m-rt = "0.6.12"
[features]
# set logging levels here
default = [
# in tests, enable all logs
"defmt-trace",
# "dependency-a/defmt-trace",
]
# do NOT modify these features
defmt-default = []
defmt-trace = []
defmt-debug = []
defmt-info = []
defmt-warn = []
defmt-error = []
+12
View File
@@ -0,0 +1,12 @@
#![no_std]
#![no_main]
use cortex_m_rt::entry;
use {{project-name}} as _; // memory layout + panic handler
#[entry]
fn main() -> ! {
assert!(false, "TODO: Write actual tests");
{{project-name}}::exit();
}