Skip to content

Commit

Permalink
Add testing framework
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSprenger committed Sep 10, 2024
1 parent 2c81b5f commit 7a55a47
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true

[config]
default_to_workspace = false

# -----------------------
# Host Testing
# -----------------------

[tasks.test-host]
dependencies = [
"test-messages",
]

# -----------------------
# Embedded Testing
# -----------------------

[tasks.test-device]
dependencies = [
"test-common-arm",
]

[tasks.test-common-arm]
command = "cargo"
args = ["test", "-p", "common-arm-test", "${@}"]
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ uORocketry's rocket instrumentation system.

- Install Rust using downloader or script https://www.rust-lang.org/tools/install
- `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`
- `cargo install probe-rs --version 0.23.0`
- `cargo install cargo-make`
- `git clone https://github.com/uorocketry/argus.git`
- `cargo b`

Expand Down
35 changes: 35 additions & 0 deletions crates/common-arm-test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[package]
name = "common-arm-test"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
common-arm = { path = "../common-arm" }
cortex-m = { workspace = true }
cortex-m-rt = "0.7.3"
defmt = "0.3.4"
defmt-rtt = "0.4.0"
defmt-test = "0.3.0"
panic-probe = { version = "0.3.1", features = ["print-defmt" ] }

# A [[test]] section is needed for each file in "tests"
[[test]]
name = "sd"
harness = false

[features]
# set logging levels here
default = [
# in tests, enable all logs
"defmt-trace",
]

# do NOT modify these features
defmt-default = []
defmt-trace = []
defmt-debug = []
defmt-info = []
defmt-warn = []
defmt-error = []

0 comments on commit 7a55a47

Please sign in to comment.