Merge pull request #190 from gnzlbg/libm_bench

Move benchmarks into its own crate
This commit is contained in:
Alex Crichton
2019-07-02 10:40:43 -05:00
committed by GitHub
6 changed files with 30 additions and 13 deletions
+1 -2
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 }
+4 -2
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
+1 -1
View File
@@ -77,7 +77,7 @@ jobs:
vmImage: ubuntu-16.04
steps:
- template: ci/azure-install-rust.yml
- bash: cargo bench
- bash: cargo bench --all
displayName: "Benchmarks"
variables:
TOOLCHAIN: nightly
+9 -5
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'
+15
View File
@@ -0,0 +1,15 @@
[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 = "../..", default-features = false }
rand = "0.6.5"
paste = "0.1.5"
[features]
default = []
stable = [ "libm/stable" ]
@@ -1,7 +1,4 @@
#![feature(test)]
extern crate paste;
extern crate rand;
extern crate test;
use rand::Rng;