From c236051681210a65a9a6bf8f8ceb06b359e355c1 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Sat, 5 Oct 2024 21:42:28 -0500 Subject: [PATCH] Rename the `musl-reference-tests` feature to `musl-bitwise-tests` The plan is to add more test related features that could be considered "reference tests". Rename the feature here to avoid future confusion. --- library/compiler-builtins/libm/CONTRIBUTING.md | 4 ++-- library/compiler-builtins/libm/ci/run.sh | 4 ++-- library/compiler-builtins/libm/crates/libm-test/Cargo.toml | 2 +- library/compiler-builtins/libm/crates/libm-test/build.rs | 4 ++-- .../libm/crates/libm-test/tests/musl_biteq.rs | 4 +++- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/library/compiler-builtins/libm/CONTRIBUTING.md b/library/compiler-builtins/libm/CONTRIBUTING.md index c15c45a4336c..1b5235db9ce0 100644 --- a/library/compiler-builtins/libm/CONTRIBUTING.md +++ b/library/compiler-builtins/libm/CONTRIBUTING.md @@ -7,7 +7,7 @@ in `src/lib.rs`. - Write some simple tests in your module (using `#[test]`) - Run `cargo test` to make sure it works -- Run `cargo test --features libm-test/musl-reference-tests` to compare your +- Run `cargo test --features libm-test/musl-bitwise-tests` to compare your implementation against musl's - Send us a pull request! Make sure to run `cargo fmt` on your code before sending the PR. Also include "closes #42" in the PR description to close the @@ -88,7 +88,7 @@ If you'd like to run tests with randomized inputs that get compared against musl itself, you'll need to be on a Linux system and then you can execute: ``` -cargo test --features libm-test/musl-reference-tests +cargo test --features libm-test/musl-bitwise-tests ``` Note that you may need to pass `--release` to Cargo if there are errors related diff --git a/library/compiler-builtins/libm/ci/run.sh b/library/compiler-builtins/libm/ci/run.sh index 2a1ac52b13c0..b5d6e45f7108 100755 --- a/library/compiler-builtins/libm/ci/run.sh +++ b/library/compiler-builtins/libm/ci/run.sh @@ -17,5 +17,5 @@ $cmd --features 'unstable' $cmd --release --features 'unstable' # also run the reference tests -$cmd --features 'unstable libm-test/musl-reference-tests' -$cmd --release --features 'unstable libm-test/musl-reference-tests' +$cmd --features 'unstable libm-test/musl-bitwise-tests' +$cmd --release --features 'unstable libm-test/musl-bitwise-tests' diff --git a/library/compiler-builtins/libm/crates/libm-test/Cargo.toml b/library/compiler-builtins/libm/crates/libm-test/Cargo.toml index 03e55b1d9a41..d04452376397 100644 --- a/library/compiler-builtins/libm/crates/libm-test/Cargo.toml +++ b/library/compiler-builtins/libm/crates/libm-test/Cargo.toml @@ -9,7 +9,7 @@ default = [] # Generate tests which are random inputs and the outputs are calculated with # musl libc. -musl-reference-tests = ["rand"] +musl-bitwise-tests = ["rand"] [dependencies] libm = { path = "../.." } diff --git a/library/compiler-builtins/libm/crates/libm-test/build.rs b/library/compiler-builtins/libm/crates/libm-test/build.rs index fc8f305d6656..09eb384103ac 100644 --- a/library/compiler-builtins/libm/crates/libm-test/build.rs +++ b/library/compiler-builtins/libm/crates/libm-test/build.rs @@ -1,9 +1,9 @@ fn main() { - #[cfg(feature = "musl-reference-tests")] + #[cfg(feature = "musl-bitwise-tests")] musl_reference_tests::generate(); } -#[cfg(feature = "musl-reference-tests")] +#[cfg(feature = "musl-bitwise-tests")] mod musl_reference_tests { use rand::seq::SliceRandom; use rand::Rng; diff --git a/library/compiler-builtins/libm/crates/libm-test/tests/musl_biteq.rs b/library/compiler-builtins/libm/crates/libm-test/tests/musl_biteq.rs index 46d4f3563064..1a6b7181709f 100644 --- a/library/compiler-builtins/libm/crates/libm-test/tests/musl_biteq.rs +++ b/library/compiler-builtins/libm/crates/libm-test/tests/musl_biteq.rs @@ -1,4 +1,6 @@ +//! compare + // PowerPC tests are failing on LLVM 13: https://github.com/rust-lang/rust/issues/88520 #[cfg(not(target_arch = "powerpc64"))] -#[cfg(all(test, feature = "musl-reference-tests"))] +#[cfg(all(test, feature = "musl-bitwise-tests"))] include!(concat!(env!("OUT_DIR"), "/musl-tests.rs"));