Commit Graph

56 Commits

Author SHA1 Message Date
Trevor Gross
23c9f74b58 Disable util and libm-macros for optimized tests
These crates take time building in CI, especially with the release
profile having LTO enabled, but there isn't really any reason to test
them with different features or in release mode. Disable this to save
some CI runtime.
2025-01-13 05:54:43 -05:00
Trevor Gross
3de783c40f Enable build-mpfr and build-musl by default
Most users who are developing this crate are likely running on a Unix
system, since there isn't much to test against otherwise. For
convenience, enable the features required to run these tests by default.
2025-01-13 03:53:46 +00:00
Trevor Gross
504616d5a0 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`.
2025-01-13 03:25:19 +00:00
Trevor Gross
5c94cce6b2 Add a release-checked profile with debug and overflow assertions
A failing debug assertion or overflow without correctly wrapping or
saturating is a bug, but the `debug` profile that has these enabled does
not run enough test cases to hit edge cases that may trigger these. Add
a new `release-checked` profile that enables debug assertions and
overflow checks. This seems to only extend per-function test time by a
few seconds (or around a minute on longer extensive tests), so enable
this as the default on CI.

In order to ensure `no_panic` still gets checked, add a build-only step
to CI.
2025-01-11 20:35:30 -05:00
Trevor Gross
5e13eeca01 Reorder tests in run.sh
I do not believe Cargo separately caches crates with different sets of
features enabled. So, ensuring that tests run with `unstable-intrinsics`
are always grouped should slightly reduce runtime.

As an added benefit, all the debug mode tests run first so initial
feedback is available faster.
2025-01-11 18:48:08 -05:00
Trevor Gross
a9407010b4 Enable MPFR tests on i586
MPFR does build and run correctly without SSE, but requires
`force-cross` be enabled.
2025-01-06 15:41:39 -05:00
Trevor Gross
f8a184e6af Run extensive tests in CI when relevant files change
Add a CI job with a dynamically calculated matrix that runs extensive
jobs on changed files. This makes use of the new
`function-definitions.json` file to determine which changed files
require full tests for a routine to run.
2025-01-06 08:56:22 +00:00
Trevor Gross
489524413b Forward the CI environment variable when running in Docker
We want to be able to adjust our configuration based on whether we are
running in CI, propagate this so our tests can use it.
2025-01-01 10:56:56 +00:00
Trevor Gross
2323d3a2e3 Always enable unstable-float in CI
Since these add new API but do not affect runtime, we can enable it for
all tests that run with nightly.
2024-12-29 07:47:21 +00:00
Trevor Gross
76f37552e7 Remove tests against system musl
We now have tests against our custom-built musl as well as tests against
MPFR. The tests against system musl covers less than those against
custom-built musl, and are less portable; there isn't much benefit to
keeping them around so just remove them.
2024-12-22 12:39:27 +00:00
Trevor Gross
659cdcad33 Enable clippy for libm in CI 2024-11-01 06:42:39 -05:00
Trevor Gross
be72d14ed5 Check benchmarks in CI 2024-10-31 22:40:30 -05:00
WANG Rui
baae082fc5 ci: add support for loongarch64-unknown-linux-gnu 2024-10-31 13:20:07 -05:00
Trevor Gross
6d1033e7fc Add an "arch" Cargo feature that is on by default
Introduce a Cargo feature to enable or disable architecture-specific
features (SIMD, assembly), which is on by default. This allows for more
fine grained control compared to relying on the `force-soft-floats`
feature.

Similar to "unstable-intrinsics", introduce a build.rs config option for
`unstable-intrinsics AND NOT force-soft-floats`, which makes this easier
to work with in code.

Effectively, this allows moving our non-additive Cargo feature
(force-soft-floats) to a positive one by default, allowing for an
override when needed.
2024-10-28 22:12:13 -05:00
Trevor Gross
54c8ae0980 Run tests against MPFR on CI where possible
This effectively gives us tests against infinite-precision results on
MacOS and x86+sse Linux.
2024-10-28 21:29:31 -05:00
Trevor Gross
3502d8eff6 Combine the WASM CI job with the others
There isn't any reason to be distinct here, and it would be better to
test with all feature configurations in run.sh anyway.
2024-10-28 20:53:35 -05:00
Trevor Gross
e6f7053c2e Replace feature = "unstable-intrinsics" with intrinsics_enabled
We currently have a non-additive feature, "force-soft-floats", and we
will need to gain another "no-f16-f128". This makes `cfg` usage in code
somewhat confusing and redundant.

Use `build.rs` to figure out if "unstable-intrinsics" is enabled while
"force-soft-floats" is not enabled and if so, emit a cfg
`intrinsics_enabled`. This is cleaner to use and should make adding more
features easier to reason about.

Also use this as an opportunity to eliminate the build.rs from the
compiler-builtins test crate, replaced with the `[lints]` table in
Cargo.toml.
2024-10-28 18:37:09 -05:00
Trevor Gross
66f8906862 Move the existing "unstable" feature to "unstable-intrinsics"
Currently there is a single feature called "unstable" that is used to
control whether intrinsics may be called. In anticipation of adding
other unstable features that we will want to control separately, create
a new feature called "unstable-intrinsics" that is enabled by
"unstable". Then move everything gated by "unstable" to
"unstable-intrinsics".
2024-10-28 18:37:09 -05:00
Trevor Gross
ebb2dc11d8 Reduce the number of iterations on emulated aarch64 Linux
CI for aarch64 Linux is significantly slower than the others. Adjust how
iteration selection is done to better handle this case, which also
simplifies things.

Also set the `EMULATED` environment variable in Docker to be more
accurate, and reindents run-docker.sh.
2024-10-28 14:04:19 -05:00
Trevor Gross
f5d30ecc3b Enable more targets on CI
This brings the targets tested here in line with those tested in
`compiler-builtins`.
2024-10-28 12:59:38 -05:00
Trevor Gross
31d0132ac1 Add dockerfiles for i586, riscv, and thumb
These targets are tested in `compiler-builtins`, but not yet `libm`. Add
dockerfiles to prepare for this.
2024-10-28 12:59:38 -05:00
Trevor Gross
5fc3068762 Add a script for downloading musl 2024-10-28 12:59:38 -05:00
Trevor Gross
a68516ed6a 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.
2024-10-25 20:57:19 -04:00
Trevor Gross
d82eb88722 Fix shellcheck warnings in scripts 2024-10-06 13:44:25 -05:00
Trevor Gross
d0f1dd6010 Set target-specific AR and CC arguments
The Rust `cc` crate reads these, so make sure they are set for when we
start making use of `cc`.
2024-10-06 00:18:00 -05:00
Trevor Gross
0be441d5ad Update Ubuntu images to 24.04
We don't have any specific reason to stay on 18.04, so upgrade to the
latest LTS version.
2024-10-06 00:10:12 -05:00
Trevor Gross
c236051681 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.
2024-10-05 21:42:28 -05:00
Trevor Gross
f59dd82cca Move musl-reference-tests to a new libm-test crate
There isn't any reason for this feature to be exposed or part of the
build script. Move it to a separate crate.

We will also want more tests that require some support functions; this
will create a place for them.
2024-10-05 15:54:39 -05:00
Trevor Gross
c7eadedd5f Deny warnings in CI
The main crate already has `#![deny(warnings)]`. Set RUSTFLAGS in CI to
enforce this for other crates in the workspace.
2024-05-06 04:51:41 -05:00
Amanieu d'Antras
4f5d1524fd Fix no-panic 2022-01-03 21:32:08 +01:00
Amanieu d'Antras
e36ee3b4b7 Disable powerpc64 tests which were broken by the LLVM 13 upgrade 2022-01-03 19:00:31 +01:00
Alex Crichton
fda4a8992f Migrate from azure pipelines to Github actions (#226)
Should make user management easier and also helps follow the repository
when it's renamed.
2019-09-10 10:07:17 -05:00
Lokathor
de3480c3c2 Update run.sh 2019-09-05 08:36:08 -06:00
Lokathor
2e3ba17f9d there are no longer any default features 2019-09-05 08:32:05 -06:00
gnzlbg
53c6687ef5 Move benchmarks into its own crate 2019-07-02 08:22:03 +02:00
Alex Crichton
f9b3247165 Update Rust install task 2019-06-13 09:21:50 -07:00
Alex Crichton
13a350ca5d Attempt to fix CI 2019-06-05 12:17:01 -07:00
Benjamin Schultzer
c6b403f5a9 Run musl test in debug mode 2019-05-16 17:09:33 -07:00
Alex Crichton
c4468281d4 More azure config fixes 2019-05-02 12:05:02 -07:00
Alex Crichton
9cf8475f2f Fix azure config 2019-05-02 11:41:20 -07:00
Alex Crichton
8d79795d70 Overhaul tests
* Move everything to azure pipelines
* Inline docker configuration in this repo (no `cross`)
* Delete `no-panic` example, use `#[no_panic]` instead.
2019-05-02 11:37:21 -07:00
Alex Crichton
ae69253dc7 Move crates to crates folder 2019-05-02 08:12:00 -07:00
Jorge Aparicio
527eefef9c tweak the order of the tests 2018-07-27 00:38:56 -05:00
Jorge Aparicio
99da9ff292 make qemu-arm executable 2018-07-27 00:21:54 -05:00
Jorge Aparicio
c626608e41 add newlib support to the test generator 2018-07-27 00:11:06 -05:00
Jorge Aparicio
47e65384f2 ci: fix if condition 2018-07-25 15:02:10 -05:00
Jorge Aparicio
657906b30c ci: add nightly build job to rnu the no-panic test 2018-07-25 14:48:49 -05:00
Jorge Aparicio
6454687134 omit bounds check in release mode
this eliminates panicking branches in the optimized version of the functions. We keep the bounds
checks when running the test suite to check that we never do an out of bounds access.

This commit also adds a "must link" test that ensures that future changes in our implementation
won't add panicking branches.

closes rust-lang/libm#129
2018-07-25 13:16:10 -05:00
Jorge Aparicio
99830bac40 test edge cases 2018-07-16 13:03:40 -05:00
Jorge Aparicio
ea8d02ae0f make cargo fmt in ci/script.sh optional 2018-07-13 22:15:21 -05:00