From a25f91b540bc7328037382720570315ddfe577a2 Mon Sep 17 00:00:00 2001 From: Adrien Touzouli Date: Wed, 16 Nov 2022 10:02:05 +0100 Subject: [PATCH 1/2] chore(test): improve test task --- Makefile.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile.toml b/Makefile.toml index 6f541f66..da417c2e 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -70,12 +70,11 @@ args = ["test", "--tests", "--workspace", "--locked", "--all-features"] command = "cargo" dependencies = ["build-coverage"] description = "Run all unit tests." -env = { LLVM_PROFILE_FILE = "default.profraw", RUST_BACKTRACE = 1 } -install_crate = { rustup_component_name = "llvm-tools-preview" } +env = { LLVM_PROFILE_FILE = "default_%p.profraw", RUST_BACKTRACE = 1, RUSTFLAGS = "-Cinstrument-coverage" } [tasks.test-coverage] dependencies = ["test"] -install_crate = { crate_name = "grcov" } +install_crate = { crate_name = "grcov", rustup_component_name = "llvm-tools-preview", binary = "grcov", test_arg = "--help" } script = ''' grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "*cargo*" -o coverage.lcov ''' From 118d3be55b3c6e6b379aa4402a9a5d8caec05be3 Mon Sep 17 00:00:00 2001 From: Adrien Touzouli Date: Thu, 17 Nov 2022 08:01:46 +0100 Subject: [PATCH 2/2] ci(test): install llvm-tools --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a59a2abf..8ae1d9d1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,6 +41,9 @@ jobs: - name: Install grcov run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi + - name: Install llvm-tools + run: rustup component add llvm-tools-preview + - name: Install cargo make uses: davidB/rust-cargo-make@v1