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

Commit f0d5182

Browse files
committed
Move benchmarks into its own crate
1 parent 04a276f commit f0d5182

File tree

5 files changed

+25
-12
lines changed

5 files changed

+25
-12
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@ checked = []
2626
[workspace]
2727
members = [
2828
"crates/compiler-builtins-smoke-test",
29+
"crates/libm-bench",
2930
]
3031

3132
[dev-dependencies]
3233
no-panic = "0.1.8"
33-
rand = "0.6.5"
34-
paste = "0.1.5"
3534

3635
[build-dependencies]
3736
rand = { version = "0.6.5", optional = true }

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ The API documentation can be found [here](https://docs.rs/libm).
3939

4040
## Benchmark
4141
[benchmark]: #benchmark
42-
Run `cargo +nightly bench`
4342

44-
NOTE: remember to have nightly installed `rustup install nightly`
43+
The benchmarks are located in `crates/libm-bench` and require a nightly Rust toolchain.
44+
To run all benchmarks:
45+
46+
> cargo +nightly bench --all
4547
4648
## Contributing
4749

ci/run.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
#!/bin/sh
1+
#!/usr/bin/env sh
22

33
set -ex
44
TARGET=$1
55

6-
cargo test --target $TARGET
7-
cargo test --target $TARGET --release
6+
CMD="cargo test --all --no-default-features --target $TARGET"
87

9-
cargo test --features 'checked musl-reference-tests' --target $TARGET
8+
$CMD
9+
$CMD --release
1010

11-
cargo test --features 'checked musl-reference-tests' --target $TARGET --release
11+
$CMD --features 'stable'
12+
$CMD --release --features 'stable'
13+
14+
$CMD --features 'stable checked musl-reference-tests'
15+
$CMD --release --features 'stable checked musl-reference-tests'

crates/libm-bench/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[package]
2+
name = "libm-bench"
3+
version = "0.1.0"
4+
authors = ["Gonzalo Brito Gadeschi <gonzalobg88@gmail.com>"]
5+
edition = "2018"
6+
license = "MIT OR Apache-2.0"
7+
8+
[dependencies]
9+
libm = { path = "../.." }
10+
rand = "0.6.5"
11+
paste = "0.1.5"

benches/bench.rs renamed to crates/libm-bench/benches/bench.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
#![feature(test)]
2-
3-
extern crate paste;
4-
extern crate rand;
52
extern crate test;
63

74
use rand::Rng;

0 commit comments

Comments
 (0)