Merge pull request #29 from knurling-rs/defmt-test
use defmt-test in the test suite
This commit is contained in:
@@ -54,4 +54,5 @@ overflow-checks = false # <-
|
|||||||
# [patch.crates-io]
|
# [patch.crates-io]
|
||||||
# defmt = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
|
# defmt = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
|
||||||
# defmt-rtt = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
|
# defmt-rtt = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
|
||||||
|
# defmt-test = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
|
||||||
# panic-probe = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
|
# panic-probe = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
|
||||||
@@ -158,10 +158,12 @@ In the example output, the supported version is `3db6b41f08a5c866e6d6ed7103d01b0
|
|||||||
-# [patch.crates-io]
|
-# [patch.crates-io]
|
||||||
-# defmt = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
|
-# defmt = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
|
||||||
-# defmt-rtt = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
|
-# defmt-rtt = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
|
||||||
|
-# defmt-test = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
|
||||||
-# panic-probe = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
|
-# panic-probe = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
|
||||||
+[patch.crates-io]
|
+[patch.crates-io]
|
||||||
+defmt = { git = "https://github.com/knurling-rs/defmt", rev = "3db6b41f08a5c866e6d6ed7103d01b0b0fe5a1f4" }
|
+defmt = { git = "https://github.com/knurling-rs/defmt", rev = "3db6b41f08a5c866e6d6ed7103d01b0b0fe5a1f4" }
|
||||||
+defmt-rtt = { git = "https://github.com/knurling-rs/defmt", rev = "3db6b41f08a5c866e6d6ed7103d01b0b0fe5a1f4" }
|
+defmt-rtt = { git = "https://github.com/knurling-rs/defmt", rev = "3db6b41f08a5c866e6d6ed7103d01b0b0fe5a1f4" }
|
||||||
|
+defmt-test = { git = "https://github.com/knurling-rs/defmt", rev = "3db6b41f08a5c866e6d6ed7103d01b0b0fe5a1f4" }
|
||||||
+panic-probe = { git = "https://github.com/knurling-rs/defmt", rev = "3db6b41f08a5c866e6d6ed7103d01b0b0fe5a1f4" }
|
+panic-probe = { git = "https://github.com/knurling-rs/defmt", rev = "3db6b41f08a5c866e6d6ed7103d01b0b0fe5a1f4" }
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ cortex-m = "0.6.3"
|
|||||||
cortex-m-rt = "0.6.12"
|
cortex-m-rt = "0.6.12"
|
||||||
defmt = "0.1.0"
|
defmt = "0.1.0"
|
||||||
defmt-rtt = "0.1.0"
|
defmt-rtt = "0.1.0"
|
||||||
|
defmt-test = "0.1.0"
|
||||||
panic-probe = { version = "0.1.0", features = ["print-defmt" ] }
|
panic-probe = { version = "0.1.0", features = ["print-defmt" ] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|||||||
+12
-5
@@ -1,12 +1,19 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![no_main]
|
#![no_main]
|
||||||
|
|
||||||
use cortex_m_rt::entry;
|
|
||||||
use {{crate_name}} as _; // memory layout + panic handler
|
use {{crate_name}} as _; // memory layout + panic handler
|
||||||
|
|
||||||
#[entry]
|
// See https://crates.io/crates/defmt-test/0.1.0 for more documentation (e.g. about the 'state'
|
||||||
fn main() -> ! {
|
// feature)
|
||||||
assert!(false, "TODO: Write actual tests");
|
#[defmt_test::tests]
|
||||||
|
mod tests {
|
||||||
|
#[test]
|
||||||
|
fn assert_true() {
|
||||||
|
assert!(true)
|
||||||
|
}
|
||||||
|
|
||||||
{{crate_name}}::exit();
|
#[test]
|
||||||
|
fn assert_false() {
|
||||||
|
assert!(false, "TODO: write actual tests")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user