forked from commure/datatest
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdatatest_stable.rs
30 lines (25 loc) · 972 Bytes
/
datatest_stable.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//! cargo +stable test --features subvert_stable_guarantees
// This test suite is configured with `harness = false` in Cargo.toml.
// So we need to make sure it has a main function when testing nightly
#[cfg(not(feature = "rustc_is_stable"))]
fn main() {}
// And uses the datatest harness when testing stable
#[cfg(feature = "rustc_is_stable")]
datatest::harness!();
#[cfg(feature = "rustc_is_stable")]
mod stable {
// Regular test have to use `datatest` variant of `#[test]` to work.
use datatest::test;
// We want to share tests between "rustc_is_nightly" and "rustc_is_stable" suites. These have to be two different
// suites as we set `harness = false` for the "stable" one.
include!("tests/mod.rs");
#[test]
fn regular_test() {
println!("regular tests also work!");
}
#[test]
fn regular_test_result() -> Result<(), Box<dyn std::error::Error>> {
println!("regular tests also work!");
Ok(())
}
}