Move benchmarks into its own crate

This commit is contained in:
gnzlbg 2019-07-02 08:22:03 +02:00
parent 04a276fb39
commit f0d518231c
5 changed files with 25 additions and 12 deletions

View File

@ -26,12 +26,11 @@ checked = []
[workspace]
members = [
"crates/compiler-builtins-smoke-test",
"crates/libm-bench",
]
[dev-dependencies]
no-panic = "0.1.8"
rand = "0.6.5"
paste = "0.1.5"
[build-dependencies]
rand = { version = "0.6.5", optional = true }

View File

@ -39,9 +39,11 @@ The API documentation can be found [here](https://docs.rs/libm).
## Benchmark
[benchmark]: #benchmark
Run `cargo +nightly bench`
NOTE: remember to have nightly installed `rustup install nightly`
The benchmarks are located in `crates/libm-bench` and require a nightly Rust toolchain.
To run all benchmarks:
> cargo +nightly bench --all
## Contributing

View File

@ -1,11 +1,15 @@
#!/bin/sh
#!/usr/bin/env sh
set -ex
TARGET=$1
cargo test --target $TARGET
cargo test --target $TARGET --release
CMD="cargo test --all --no-default-features --target $TARGET"
cargo test --features 'checked musl-reference-tests' --target $TARGET
$CMD
$CMD --release
cargo test --features 'checked musl-reference-tests' --target $TARGET --release
$CMD --features 'stable'
$CMD --release --features 'stable'
$CMD --features 'stable checked musl-reference-tests'
$CMD --release --features 'stable checked musl-reference-tests'

View File

@ -0,0 +1,11 @@
[package]
name = "libm-bench"
version = "0.1.0"
authors = ["Gonzalo Brito Gadeschi <gonzalobg88@gmail.com>"]
edition = "2018"
license = "MIT OR Apache-2.0"
[dependencies]
libm = { path = "../.." }
rand = "0.6.5"
paste = "0.1.5"

View File

@ -1,7 +1,4 @@
#![feature(test)]
extern crate paste;
extern crate rand;
extern crate test;
use rand::Rng;