Skip to content

Commit c42e742

Browse files
authored
Test refactors and coverage (#6)
## Summary This adds a substantial refactor to our test suite as well as tooling for coverage and nicer test runner with nextest. ## Type of Change <!-- Mark with an `x` all that apply --> - [ ] 🐛 Bug fix (non-breaking change that fixes an issue) - [ ] ✨ New feature (non-breaking change that adds functionality) - [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 📚 Documentation update - [x] 🧹 Code cleanup or refactoring - [ ] 🔧 Build system or dependency changes - [x] 🧪 Test improvements ## How Has This Been Tested? <!-- Describe the tests you ran to verify your changes --> - [x] Existing tests pass (`mise test`) - [x] New tests added for new functionality - [x] Manual testing performed - [x] Code follows style guidelines (`mise lint`)
2 parents 564fb64 + 8ad2736 commit c42e742

File tree

6 files changed

+716
-172
lines changed

6 files changed

+716
-172
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/.idea/
2+
/coverage/
23
/target/
34
.DS_Store

bin/setup

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env sh
22
#MISE description="install dependencies and setup the dev environment"
33

4-
cargo install cargo-audit cargo-outdated cargo-sort
4+
rustup component add --toolchain nightly-x86_64-unknown-linux-gnu clippy
5+
cargo install cargo-audit cargo-llvm-cov cargo-nextest cargo-outdated cargo-sort

bin/test

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
#MISE description="run unit tests"
33
#MISE alias=["t"]
44

5-
cargo test
5+
cargo llvm-cov nextest --branch --summary-only
6+
cargo llvm-cov report --branch --html --output-dir coverage
7+
cargo llvm-cov report --branch --lcov --output-path coverage/lcov.info

mise.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,10 @@
22
includes = ["bin"]
33

44
[tools]
5+
"cargo:cargo-audit" = "latest"
6+
"cargo:cargo-llvm-cov" = "latest"
7+
"cargo:cargo-nextest" = "latest"
8+
"cargo:cargo-outdated" = "latest"
9+
"cargo:cargo-sort" = "latest"
510
"npm:markdownlint-cli" = "latest"
6-
rust = "1.89"
11+
rust = { version = "nightly", components = "clippy,llvm-tools-preview,rustfmt,rust-src" }

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
22
channel = "nightly"
3-
components = ["clippy", "rustfmt"]
3+
components = ["clippy", "llvm-tools-preview", "rustfmt", "rust-src"]

0 commit comments

Comments
 (0)