Merge pull request #9 from knurling-rs/testsuite

Add an on-device test suite
This commit is contained in:
Jonas Schievink
2020-09-01 16:37:46 +02:00
committed by GitHub
3 changed files with 61 additions and 0 deletions
+3
View File
@@ -5,6 +5,9 @@ name = "{{project-name}}"
edition = "2018"
version = "0.1.0"
[workspace]
members = ["testsuite"]
[dependencies.defmt]
git = "https://github.com/knurling-rs/defmt"
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 {{crate_name}} as _; // memory layout + panic handler
#[entry]
fn main() -> ! {
assert!(false, "TODO: Write actual tests");
{{crate_name}}::exit();
}