Skip to content

Commit 62c04aa

Browse files
committed
minicrater: test fixed, build-fail and test-fail
1 parent 19e18e7 commit 62c04aa

File tree

8 files changed

+95
-0
lines changed

8 files changed

+95
-0
lines changed

local-crates/beta-fixed/Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
name = "beta-fixed"
3+
version = "0.1.0"
4+
authors = ["Pietro Albini <[email protected]>"]
5+
6+
[dependencies]
7+
8+
[build-dependencies]
9+
rustc_version = "0.2.3"

local-crates/beta-fixed/build.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extern crate rustc_version;
2+
3+
use rustc_version::{version_meta, Channel};
4+
5+
fn main() {
6+
if let Channel::Beta = version_meta().unwrap().channel {
7+
println!("cargo:rustc-cfg=channel_beta");
8+
}
9+
10+
// Rebuild the crate only if the build.rs file changes
11+
println!("cargo:rebuild-if-changed=build.rs");
12+
}

local-crates/beta-fixed/src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#[cfg(not(channel_beta))]
2+
compile_error!("Non-beta regression \\o/");
3+
4+
fn main() {
5+
println!("Hello, world!");
6+
}

local-crates/build-fail/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[package]
2+
name = "build-fail"
3+
version = "0.1.0"
4+
authors = ["Pietro Albini <[email protected]>"]
5+
6+
[dependencies]

local-crates/build-fail/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
invalid syntax :(
3+
}

local-crates/test-fail/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[package]
2+
name = "test-fail"
3+
version = "0.1.0"
4+
authors = ["Pietro Albini <[email protected]>"]
5+
6+
[dependencies]

local-crates/test-fail/src/main.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
fn main() {
2+
println!("Hello, world!");
3+
}
4+
5+
#[test]
6+
fn bad_test() {
7+
panic!("this crate is just broken");
8+
}

tests/minicrater/results.expected.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
{
22
"crates": [
3+
{
4+
"name": "beta-fixed (local)",
5+
"res": "Fixed",
6+
"runs": [
7+
{
8+
"log": "stable/local/beta-fixed",
9+
"res": "BuildFail"
10+
},
11+
{
12+
"log": "beta/local/beta-fixed",
13+
"res": "TestPass"
14+
}
15+
],
16+
"url": "https://github.com/rust-lang-nursery/crater/tree/master/local-crates/beta-fixed"
17+
},
318
{
419
"name": "beta-regression (local)",
520
"res": "Regressed",
@@ -15,6 +30,21 @@
1530
],
1631
"url": "https://github.com/rust-lang-nursery/crater/tree/master/local-crates/beta-regression"
1732
},
33+
{
34+
"name": "build-fail (local)",
35+
"res": "SameBuildFail",
36+
"runs": [
37+
{
38+
"log": "stable/local/build-fail",
39+
"res": "BuildFail"
40+
},
41+
{
42+
"log": "beta/local/build-fail",
43+
"res": "BuildFail"
44+
}
45+
],
46+
"url": "https://github.com/rust-lang-nursery/crater/tree/master/local-crates/build-fail"
47+
},
1848
{
1949
"name": "build-pass (local)",
2050
"res": "SameTestPass",
@@ -29,6 +59,21 @@
2959
}
3060
],
3161
"url": "https://github.com/rust-lang-nursery/crater/tree/master/local-crates/build-pass"
62+
},
63+
{
64+
"name": "test-fail (local)",
65+
"res": "SameTestFail",
66+
"runs": [
67+
{
68+
"log": "stable/local/test-fail",
69+
"res": "TestFail"
70+
},
71+
{
72+
"log": "beta/local/test-fail",
73+
"res": "TestFail"
74+
}
75+
],
76+
"url": "https://github.com/rust-lang-nursery/crater/tree/master/local-crates/test-fail"
3277
}
3378
]
3479
}

0 commit comments

Comments
 (0)