Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor testing framework into a libm-test #198

Closed
wants to merge 43 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
311f945
Move libm to the crates directory
gnzlbg Jul 4, 2019
0d32984
WIP: Verification of libm API
gnzlbg Jul 4, 2019
5570b2f
libm-analyze: a proc macro to analyze libm APIs
gnzlbg Jul 4, 2019
fa2dde0
The FP environment functions are private
gnzlbg Jul 4, 2019
28d7851
libm-test: expands tests for all libm APIs
gnzlbg Jul 4, 2019
4787bfc
Remove old build.rs testing
gnzlbg Jul 4, 2019
38b1828
Move most unit tests to the libm-test crate
gnzlbg Jul 4, 2019
412595b
Only run system tests on x86_64-unknown-linux-musl for now
gnzlbg Jul 4, 2019
a3838d9
libm-analyze does not require proc_macro_diagnostics anymore
gnzlbg Jul 4, 2019
fae0b0a
Add readmes to the two new crates
gnzlbg Jul 4, 2019
6ef8fa7
Improve doc comments
gnzlbg Jul 4, 2019
e272698
Remove duplicate check in equal
gnzlbg Jul 4, 2019
7d73ae1
Document and refactor libm-test a bit
gnzlbg Jul 4, 2019
7b9f17f
Reformat libm-analyze
gnzlbg Jul 4, 2019
2460d47
wasm32 should only build the libm crate on Azure
gnzlbg Jul 4, 2019
36958fd
Use of core::intrinsics was improperly feature-gated for wasm32
gnzlbg Jul 4, 2019
c3afab4
Improve error messages for libm-test
gnzlbg Jul 4, 2019
17234d6
Only run system tests for musl
gnzlbg Jul 4, 2019
5e85499
Fix typo
gnzlbg Jul 4, 2019
8abd2f9
Nitpicks
gnzlbg Jul 4, 2019
1d77d0a
Refactor the Call trait into the test lib
gnzlbg Jul 4, 2019
82a5c69
Migrate libm-bench to libm-analyze
gnzlbg Jul 5, 2019
dd17777
Fix typo
gnzlbg Jul 5, 2019
8c06185
Add exhaustive testing of the 32-bit APIs
gnzlbg Jul 5, 2019
63ec2ef
Add missing inline and nopanic attributes
gnzlbg Jul 5, 2019
1eed20b
Deny missing no_panic and inline attrs
gnzlbg Jul 5, 2019
a11a6fe
Add remaining no_panic and inline attrs
gnzlbg Jul 5, 2019
a27bd10
Make all public APIs extern C to enforce nounwind and C API compat
gnzlbg Jul 5, 2019
7b214c8
Put exhaustive tests behind feature test
gnzlbg Jul 5, 2019
c8eeb45
Always build exhaustive tests on CI
gnzlbg Jul 5, 2019
4eb8ed4
Enforce extern C in libm-analyze
gnzlbg Jul 5, 2019
1a49d70
Really build the exhaustive tests on CI
gnzlbg Jul 5, 2019
b10d776
Remove workarounds due to lack of extern C APIs
gnzlbg Jul 5, 2019
480ebc1
Use inclusive range for testing all f32 bit patterns
gnzlbg Jul 5, 2019
b849b08
Add nextafter and nextafterf
gnzlbg Jul 5, 2019
308daa3
Add nexttoward and signbit
gnzlbg Jul 5, 2019
7ef6fc2
Fix segfaults in FMA for some inputs
gnzlbg Jul 5, 2019
41b817d
Refactor random tests into lib; be more exhaustive at boundaries.
gnzlbg Jul 5, 2019
ae3ab74
Use approx_eq in unit tests
gnzlbg Jul 5, 2019
f81edcc
Silence clippy warnings for libm and add clippy to CI
gnzlbg Jul 5, 2019
f9f59e0
Refactor libm-test; add tests specifics for each type of API
gnzlbg Jul 5, 2019
e0fe716
Fix clippy nits
gnzlbg Jul 5, 2019
6e323e9
Remove nexttoward/f, signbit/f, and disable fma system tests - failure
gnzlbg Jul 5, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 4 additions & 32 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,36 +1,8 @@
[package]
authors = ["Jorge Aparicio <jorge@japaric.io>"]
categories = ["no-std"]
description = "libm in pure Rust"
documentation = "https://docs.rs/libm"
keywords = ["libm", "math"]
license = "MIT OR Apache-2.0"
name = "libm"
repository = "https://github.com/rust-lang-nursery/libm"
version = "0.2.0"
edition = "2018"

[features]
# only used to run our test suite
default = ['stable']
stable = []

# Generate tests which are random inputs and the outputs are calculated with
# musl libc.
musl-reference-tests = ['rand']

# Used checked array indexing instead of unchecked array indexing in this
# library.
checked = []

[workspace]
members = [
"crates/libm",
"crates/libm-analyze",
"crates/libm-test",
"crates/compiler-builtins-smoke-test",
"crates/libm-bench",
]

[dev-dependencies]
no-panic = "0.1.8"

[build-dependencies]
rand = { version = "0.6.5", optional = true }
]
10 changes: 7 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ jobs:
- template: ci/azure-install-rust.yml
- script: rustup target add wasm32-unknown-unknown
displayName: "Install rust wasm target"
- script: cargo build --target wasm32-unknown-unknown
- script: cargo build -p libm --target wasm32-unknown-unknown
displayName: "Build for wasm"
- script: cargo build --target wasm32-unknown-unknown --no-default-features
- script: cargo build -p libm --target wasm32-unknown-unknown --no-default-features
displayName: "Build for wasm (no default features)"
variables:
TOOLCHAIN: nightly

- job: rustfmt
- job: tools
pool:
vmImage: ubuntu-16.04
steps:
Expand All @@ -63,6 +63,10 @@ jobs:
displayName: "install rustfmt"
- bash: cargo fmt --all -- --check
displayName: "check formatting"
- bash: rustup component add clippy
displayName: "install clippy"
- bash: cargo clippy --all -- -D clippy::pedantic
displayName: "check clippy"

- job: compiler_builtins_works
pool:
Expand Down
Loading