From 476d997c832389927c2e5ac72b042b7805b17f2e Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 19 Oct 2024 10:31:38 +0200 Subject: [PATCH] More adjustments --- .github/workflows/test.yml | 2 +- Cargo.toml | 3 ++ azure-pipelines.yml | 57 -------------------------------------- src/map.rs | 30 ++++++++++---------- src/set.rs | 2 +- tarpaulin.toml | 2 -- 6 files changed, 20 insertions(+), 76 deletions(-) delete mode 100644 azure-pipelines.yml delete mode 100644 tarpaulin.toml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f7540ae..de78397 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -145,7 +145,7 @@ jobs: if: hashFiles('Cargo.lock') == '' run: cargo generate-lockfile - name: cargo llvm-cov - run: cargo llvm-cov --locked --all-features --lcov --output-path lcov.info + run: cargo llvm-cov --locked --features serde,rayon --lcov --output-path lcov.info - name: Record Rust version run: echo "RUST=$(rustc --version)" >> "$GITHUB_ENV" - name: Upload to codecov.io diff --git a/Cargo.toml b/Cargo.toml index f0b8cbe..ef3df22 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,3 +50,6 @@ features = ["rayon", "serde", "raw"] [[bench]] name = "vroom" harness = false + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage,coverage_nightly)'] } diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index bb9bfbc..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,57 +0,0 @@ -jobs: - - template: default.yml@templates - parameters: - minrust: 1.42.0 # const-random-macro - codecov_token: $(CODECOV_TOKEN_SECRET) - env: - QUICKCHECK_TESTS: 500 - - job: no_std - dependsOn: [] - displayName: "Compile-check on no_std target" - pool: - vmImage: ubuntu-latest - steps: - - template: install-rust.yml@templates - parameters: - rust: nightly - targets: - - thumbv7m-none-eabi - - bash: cargo check --target thumbv7m-none-eabi - displayName: cargo check --target thumbv7m-none-eabi - - job: features - displayName: "Check feature combinations" - pool: - vmImage: ubuntu-latest - steps: - - template: install-rust.yml@templates - parameters: - rust: stable - - script: cargo install cargo-hack - displayName: install cargo-hack - - script: cargo hack --feature-powerset check - displayName: cargo hack - - job: miri - displayName: "Run miri on test suite" - pool: - vmImage: ubuntu-latest - steps: - - bash: | - echo '##vso[task.setvariable variable=nightly]nightly-'$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri) - displayName: "Determine latest miri nightly" - - template: install-rust.yml@templates - parameters: - rust: $(nightly) - components: - - miri - - script: cargo miri test --features serde,raw - displayName: cargo miri test - env: - MIRIFLAGS: -Zmiri-ignore-leaks - -resources: - repositories: - - repository: templates - type: github - name: crate-ci/azure-pipelines - ref: refs/heads/v0.4 - endpoint: jonhoo diff --git a/src/map.rs b/src/map.rs index eef18ad..1206432 100644 --- a/src/map.rs +++ b/src/map.rs @@ -3166,7 +3166,7 @@ fn assert_covariance() { } #[cfg(test)] -#[cfg(not(tarpaulin_include))] // don't count for coverage +#[cfg_attr(coverage, coverage(off))] mod test_map { use super::DefaultHashBuilder; use super::Entry::{Occupied, Vacant}; @@ -3603,14 +3603,14 @@ mod test_map { fn test_lots_of_insertions() { let mut m = HashMap::new(); - #[cfg(not(any(tarpaulin, miri)))] + #[cfg(not(any(coverage, miri)))] const N: usize = 10; - #[cfg(any(tarpaulin, miri))] + #[cfg(any(coverage, miri))] const N: usize = 5; - #[cfg(not(any(tarpaulin, miri)))] + #[cfg(not(any(coverage, miri)))] const M: usize = 1001; - #[cfg(tarpaulin)] + #[cfg(coverage)] const M: usize = 101; #[cfg(miri)] const M: usize = 16; @@ -3678,14 +3678,14 @@ mod test_map { fn test_lots_of_raw_insertions() { let mut m = HashMap::new(); - #[cfg(not(any(tarpaulin, miri)))] + #[cfg(not(any(coverage, miri)))] const N: usize = 10; - #[cfg(any(tarpaulin, miri))] + #[cfg(any(coverage, miri))] const N: usize = 5; - #[cfg(not(any(tarpaulin, miri)))] + #[cfg(not(any(coverage, miri)))] const M: usize = 1001; - #[cfg(tarpaulin)] + #[cfg(coverage)] const M: usize = 101; #[cfg(miri)] const M: usize = 16; @@ -3790,9 +3790,9 @@ mod test_map { fn test_raw_entry_mut_and_modify() { let mut m = HashMap::new(); - #[cfg(not(any(tarpaulin, miri)))] + #[cfg(not(any(coverage, miri)))] const M: usize = 1001; - #[cfg(tarpaulin)] + #[cfg(coverage)] const M: usize = 101; #[cfg(miri)] const M: usize = 16; @@ -4656,16 +4656,16 @@ mod test_map { #[test] fn test_raw_occupied_entry_mut() { - #[cfg(not(any(tarpaulin, miri)))] + #[cfg(not(any(coverage, miri)))] const M: usize = 1001; - #[cfg(tarpaulin)] + #[cfg(coverage)] const M: usize = 101; #[cfg(miri)] const M: usize = 16; - #[cfg(not(any(tarpaulin, miri)))] + #[cfg(not(any(coverage, miri)))] const N: usize = 10; - #[cfg(any(tarpaulin, miri))] + #[cfg(any(coverage, miri))] const N: usize = 5; let mut m = HashMap::new(); diff --git a/src/set.rs b/src/set.rs index 16c68d8..530f0d3 100644 --- a/src/set.rs +++ b/src/set.rs @@ -1709,7 +1709,7 @@ fn assert_covariance() { } #[cfg(test)] -#[cfg(not(tarpaulin_include))] // don't count for coverage +#[cfg_attr(coverage, coverage(off))] mod test_set { use super::super::map::DefaultHashBuilder; use super::HashSet; diff --git a/tarpaulin.toml b/tarpaulin.toml deleted file mode 100644 index fcf2654..0000000 --- a/tarpaulin.toml +++ /dev/null @@ -1,2 +0,0 @@ -[main] -features = "rayon serde raw"