]> git.proxmox.com Git - rustc.git/blob - vendor/rayon/src/test.rs
New upstream version 1.32.0~beta.2+dfsg1
[rustc.git] / vendor / rayon / src / test.rs
1 #![cfg(test)]
2 #![cfg(not(all(windows, target_env = "gnu")))]
3
4 extern crate compiletest_rs as compiletest;
5
6 use std::path::PathBuf;
7
8 fn run_compiletest(mode: &str, path: &str) {
9 let mut config = compiletest::Config::default();
10 config.mode = mode.parse().ok().expect("Invalid mode");
11 config.src_base = PathBuf::from(path);
12 config.target_rustcflags = Some("-L target/debug/ -L target/debug/deps/".to_owned());
13
14 compiletest::run_tests(&config);
15 }
16
17 #[test]
18 fn negative_tests_compile_fail() {
19 run_compiletest("compile-fail", "tests/compile-fail");
20 }
21
22 #[test]
23 #[cfg(rayon_unstable)]
24 fn negative_tests_compile_fail_unstable() {
25 run_compiletest("compile-fail", "tests/compile-fail-unstable");
26 }
27
28 #[test]
29 fn negative_tests_run_fail() {
30 run_compiletest("run-fail", "tests/run-fail");
31 }
32
33 #[test]
34 #[cfg(rayon_unstable)]
35 fn negative_tests_run_fail_unstable() {
36 run_compiletest("run-fail", "tests/run-fail-unstable");
37 }
38
39 #[test]
40 fn positive_test_run_pass() {
41 run_compiletest("run-pass", "tests/run-pass");
42 }
43
44 #[test]
45 #[cfg(rayon_unstable)]
46 fn positive_test_run_pass_unstable() {
47 run_compiletest("run-pass", "tests/run-pass-unstable");
48 }