Skip to content

Commit

Permalink
build: add coverage recipes to justfile
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Jun 10, 2024
1 parent 7f529e3 commit 53086a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion actix-web/src/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ fn bare_address(val: &str) -> &str {
val.split("]:")
.next()
.map(|s| s.trim_start_matches('[').trim_end_matches(']'))
// This shouldn't *actually* ever happen
// this indicates that the IPv6 address is malformed so shouldn't
// usually happen, but if it does, just return the original input
.unwrap_or(val)
} else {
val.split(':').next().unwrap_or(val)
Expand Down
8 changes: 8 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ test-docs toolchain="": && doc
# Test workspace.
test-all toolchain="": (test toolchain) (test-docs toolchain)

# Test workspace and generate Codecov coverage file.
test-coverage-codecov toolchain="":
cargo {{ toolchain }} llvm-cov --workspace {{ all_crate_features }} --codecov --output-path codecov.json

# Test workspace and generate LCOV coverage file.
test-coverage-lcov toolchain="":
cargo {{ toolchain }} llvm-cov --workspace {{ all_crate_features }} --lcov --output-path lcov.info

# Document crates in workspace.
doc *args:
RUSTDOCFLAGS="--cfg=docsrs -Dwarnings" cargo +nightly doc --no-deps --workspace {{ all_crate_features }} {{ args }}
Expand Down

0 comments on commit 53086a9

Please sign in to comment.