Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable branch coverage #81

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,23 @@ udeps:

# Run all tests with nextest and cargo-llvm-cov
ci-test:
#!/bin/bash -eux
source <(cargo llvm-cov show-env --export-prefix)
cargo llvm-cov clean --workspace

export RUST_LOG=trace
cargo nextest run --release --all-features --profile ci
export ONE_BYTE_READ=1
cargo nextest run --release --all-features --profile ci

cargo llvm-cov report --release --ignore-filename-regex 'corpus/mod\.rs$' --lcov --output-path coverage.lcov
cargo llvm-cov report --release --ignore-filename-regex 'corpus/mod\.rs$' --html
#!/bin/bash -eux
export RUSTUP_TOOLCHAIN=nightly
rustup component add llvm-tools
cargo llvm-cov --version

cargo llvm-cov show-env --branch --export-prefix > /tmp/llvm-cov-env
echo "======= LLVM cov env ======="
cat /tmp/llvm-cov-env
echo "============================"
source /tmp/llvm-cov-env

cargo llvm-cov clean --workspace

export RUST_LOG=trace
cargo nextest run --release --all-features --profile ci
export ONE_BYTE_READ=1
cargo nextest run --release --all-features --profile ci

cargo llvm-cov report --release --ignore-filename-regex 'corpus/mod\.rs$' --lcov --output-path coverage.lcov
cargo llvm-cov report --release --ignore-filename-regex 'corpus/mod\.rs$' --html
24 changes: 12 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@
version = "latest";
strictDeps = true;
dontStrip = true;
# workaround for https://github.com/NixOS/nixpkgs/issues/166205
env = with pkgs; lib.optionalAttrs stdenv.cc.isClang {
NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
};
inherit src buildInputs nativeBuildInputs;
};
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
Expand All @@ -68,8 +64,7 @@
default = bin;
};
devShells.default = mkShell {
inputsFrom = [ bin ];
packages = with pkgs; [ just nixpkgs-fmt ];
packages = with pkgs; [ just nixpkgs-fmt mold libiconv ];
};
}
);
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "stable"
channel = "1.77.0"
components = ["llvm-tools", "clippy", "rust-src"]