Skip to content

Commit

Permalink
wip: branch coverage
Browse files Browse the repository at this point in the history
cf. #80
  • Loading branch information
fasterthanlime committed Mar 22, 2024
1 parent 1ce6281 commit 5790c98
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 30 deletions.
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"]

0 comments on commit 5790c98

Please sign in to comment.