This commit alters the test suite to unconditionally compile and run all tests, regardless of the ambient target features enabled. This then uses a new convenience macro, `#[simd_test]`, to guard all tests with the appropriate `cfg_feature_enabled!` and also enable the `#[target_feature]` appropriately.
10 lines
333 B
Rust
10 lines
333 B
Rust
use std::env;
|
|
|
|
fn main() {
|
|
println!("cargo:rerun-if-changed=build.rs");
|
|
let opt_level = env::var("OPT_LEVEL").ok().and_then(|s| s.parse().ok()).unwrap_or(0);
|
|
let profile = env::var("PROFILE").unwrap_or(String::new());
|
|
if profile == "release" || opt_level >= 2 {
|
|
println!("cargo:rustc-cfg=optimized");
|
|
}
|
|
}
|