From a68516ed6aa0489a1e225277598423f627fd45f4 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 25 Oct 2024 20:57:19 -0400 Subject: [PATCH] Rename the `musl-bitwise-tests` feature to `test-musl-serialized` We will have more test features in the near future, and it would be nice for them all to have a common `test-` prefix. Reverse the existing feature so this is the case. --- library/compiler-builtins/libm/CONTRIBUTING.md | 8 ++++---- library/compiler-builtins/libm/ci/run.sh | 4 ++-- .../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 | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/library/compiler-builtins/libm/CONTRIBUTING.md b/library/compiler-builtins/libm/CONTRIBUTING.md index 1b5235db9ce0..a39623696c4a 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-bitwise-tests` to compare your +- Run `cargo test --features libm-test/test-musl-serialized` 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 @@ -80,15 +80,15 @@ let x1p127 = f32::from_bits(0x7f000000); // 0x1p127f === 2 ^ 12 Normal tests can be executed with: -``` +```sh cargo test ``` 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-bitwise-tests +```sh +cargo test --features libm-test/test-musl-serialized ``` 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 1b016cc4fb2a..505e2589187b 100755 --- a/library/compiler-builtins/libm/ci/run.sh +++ b/library/compiler-builtins/libm/ci/run.sh @@ -18,5 +18,5 @@ $cmd --features 'unstable' $cmd --release --features 'unstable' # also run the reference tests -$cmd --features 'unstable libm-test/musl-bitwise-tests' -$cmd --release --features 'unstable libm-test/musl-bitwise-tests' +$cmd --features 'unstable libm-test/test-musl-serialized' +$cmd --release --features 'unstable libm-test/test-musl-serialized' diff --git a/library/compiler-builtins/libm/crates/libm-test/Cargo.toml b/library/compiler-builtins/libm/crates/libm-test/Cargo.toml index 7c193d3bbca8..6367bdca52c0 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-bitwise-tests = ["rand"] +test-musl-serialized = ["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 c2c4b0bd28ed..3a49e3c57315 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-bitwise-tests")] + #[cfg(feature = "test-musl-serialized")] musl_reference_tests::generate(); } -#[cfg(feature = "musl-bitwise-tests")] +#[cfg(feature = "test-musl-serialized")] 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 1a6b7181709f..f586fd03d12c 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 @@ -2,5 +2,5 @@ // 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-bitwise-tests"))] +#[cfg(all(test, feature = "test-musl-serialized"))] include!(concat!(env!("OUT_DIR"), "/musl-tests.rs"));