From 53086a90a679e609ae6afe43d0eb94cdb270f3c0 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Mon, 10 Jun 2024 01:58:13 +0100 Subject: [PATCH] build: add coverage recipes to justfile --- actix-web/src/info.rs | 3 ++- justfile | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/actix-web/src/info.rs b/actix-web/src/info.rs index aee936ba9..1b2e554f9 100644 --- a/actix-web/src/info.rs +++ b/actix-web/src/info.rs @@ -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) diff --git a/justfile b/justfile index 4e106ef11..7f6dbb61e 100644 --- a/justfile +++ b/justfile @@ -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 }}