Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit aecd822

Browse files
committed
Rename the test-multiprecision feature to build-mpfr
Currently the features that control what we test against are `build-musl` and `test-multiprecision`. I didn't name them very consistently and there isn't really any reason for that. Rename `test-multiprecision` to `build-mpfr` to better reflect what it actually does and to be more consistent with `build-musl`.
1 parent a7a1be1 commit aecd822

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

libm/.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
run: ./ci/download-musl.sh
134134
- run: |
135135
cargo clippy --all \
136-
--features libm-test/build-musl,libm-test/test-multiprecision \
136+
--features libm-test/build-musl,libm-test/build-mpfr \
137137
--all-targets
138138
139139
builtins:
@@ -241,7 +241,7 @@ jobs:
241241
fi
242242
243243
LIBM_EXTENSIVE_TESTS="$CHANGED" cargo t \
244-
--features test-multiprecision,unstable \
244+
--features build-mpfr,unstable \
245245
--profile release-checked \
246246
-- extensive
247247
- name: Print test logs if available

libm/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ If you'd like to run tests with randomized inputs that get compared against
6969
infinite-precision results, run:
7070

7171
```sh
72-
cargo test --features libm-test/test-multiprecision,libm-test/build-musl --release
72+
cargo test --features libm-test/build-mpfr,libm-test/build-musl --release
7373
```
7474

7575
The multiprecision tests use the [`rug`] crate for bindings to MPFR. MPFR can

libm/ci/run.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ case "$target" in
4444
# Targets that aren't cross compiled work fine
4545
# FIXME(ci): we should be able to enable aarch64 Linux here once GHA
4646
# support rolls out.
47-
x86_64*) extra_flags="$extra_flags --features libm-test/test-multiprecision" ;;
48-
i686*) extra_flags="$extra_flags --features libm-test/test-multiprecision" ;;
49-
i586*) extra_flags="$extra_flags --features libm-test/test-multiprecision --features gmp-mpfr-sys/force-cross" ;;
47+
x86_64*) extra_flags="$extra_flags --features libm-test/build-mpfr" ;;
48+
i686*) extra_flags="$extra_flags --features libm-test/build-mpfr" ;;
49+
i586*) extra_flags="$extra_flags --features libm-test/build-mpfr --features gmp-mpfr-sys/force-cross" ;;
5050
# Apple aarch64 is native
51-
aarch64*apple*) extra_flags="$extra_flags --features libm-test/test-multiprecision" ;;
51+
aarch64*apple*) extra_flags="$extra_flags --features libm-test/build-mpfr" ;;
5252
esac
5353

5454
# FIXME: `STATUS_DLL_NOT_FOUND` testing macros on CI.

libm/crates/libm-test/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ unstable-float = ["libm/unstable-float", "rug?/nightly-float"]
1212

1313
# Generate tests which are random inputs and the outputs are calculated with
1414
# musl libc.
15-
test-multiprecision = ["dep:az", "dep:rug", "dep:gmp-mpfr-sys"]
15+
build-mpfr = ["dep:az", "dep:rug", "dep:gmp-mpfr-sys"]
1616

1717
# Build our own musl for testing and benchmarks
1818
build-musl = ["dep:musl-math-sys"]

libm/crates/libm-test/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
pub mod domain;
66
mod f8_impl;
77
pub mod gen;
8-
#[cfg(feature = "test-multiprecision")]
8+
#[cfg(feature = "build-mpfr")]
99
pub mod mpfloat;
1010
mod num;
1111
pub mod op;

libm/crates/libm-test/src/run_cfg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl TestEnv {
126126
let id = ctx.fn_ident;
127127
let op = id.math_op();
128128

129-
let will_run_mp = cfg!(feature = "test-multiprecision");
129+
let will_run_mp = cfg!(feature = "build-mpfr");
130130

131131
// Tests are pretty slow on non-64-bit targets, x86 MacOS, and targets that run in QEMU. Start
132132
// with a reduced number on these platforms.

libm/crates/libm-test/tests/multiprecision.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Test with "infinite precision"
22
3-
#![cfg(feature = "test-multiprecision")]
3+
#![cfg(feature = "build-mpfr")]
44

55
use libm_test::domain::HasDomain;
66
use libm_test::gen::random::RandomInput;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//! `main` is just a wrapper to handle configuration.
22
3-
#[cfg(not(feature = "test-multiprecision"))]
3+
#[cfg(not(feature = "build-mpfr"))]
44
fn main() {
55
eprintln!("multiprecision not enabled; skipping extensive tests");
66
}
77

8-
#[cfg(feature = "test-multiprecision")]
8+
#[cfg(feature = "build-mpfr")]
99
mod run;
1010

11-
#[cfg(feature = "test-multiprecision")]
11+
#[cfg(feature = "build-mpfr")]
1212
fn main() {
1313
run::run();
1414
}

0 commit comments

Comments
 (0)