Skip to content

Commit 37c65ff

Browse files
authored
Merge pull request #5 from informalsystems/erick/fix_nighly
Split divergent tests into nightly and stable
2 parents f9f71cc + 50a4169 commit 37c65ff

File tree

12 files changed

+106
-3
lines changed

12 files changed

+106
-3
lines changed

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

connect/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ similar = "2.7"
2727

2828
[dev-dependencies]
2929
trybuild = { version = "1.0.114", features = ["diff"] }
30+
31+
[build-dependencies]
32+
version_check = "0.9"

connect/build.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
fn main() {
2+
let channel = version_check::Channel::read().expect("Failed to read rustc channel");
3+
4+
// Allow for the #[cfg(nightly)] config
5+
println!("cargo::rustc-check-cfg=cfg(nightly)");
6+
7+
if channel.is_nightly() {
8+
// Enable the #[cfg(nightly)] config
9+
println!("cargo:rustc-cfg=nightly");
10+
}
11+
}

connect/tests/macros.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,17 @@ fn test_macros() {
44
t.pass("tests/macros/*/pass/*.rs");
55
t.compile_fail("tests/macros/*/fail/*.rs");
66
}
7+
8+
#[test]
9+
#[cfg(not(nightly))]
10+
fn test_macros_stable() {
11+
let t = trybuild::TestCases::new();
12+
t.compile_fail("tests/macros/*/fail/stable/*.rs");
13+
}
14+
15+
#[test]
16+
#[cfg(nightly)]
17+
fn test_macros_nightly() {
18+
let t = trybuild::TestCases::new();
19+
t.compile_fail("tests/macros/*/fail/nightly/*.rs");
20+
}

connect/tests/macros/quint_run/fail/invalid_num.rs renamed to connect/tests/macros/quint_run/fail/nighly/invalid_num.rs

File renamed without changes.

connect/tests/macros/quint_run/fail/invalid_num.stderr renamed to connect/tests/macros/quint_run/fail/nighly/invalid_num.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: invalid digit found in string
22
--> tests/macros/quint_run/fail/invalid_num.rs:13:46
33
|
44
13 | #[quint_run(spec = "spec.qnt", max_samples = -666)]
5-
| ^
5+
| ^^^^
66

77
error: expected integer literal
88
--> tests/macros/quint_run/fail/invalid_num.rs:18:46
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
use quint_connect::*;
2+
3+
struct TestDriver;
4+
5+
impl Driver for TestDriver {
6+
type State = ();
7+
8+
fn step(&mut self, _step: &Step) -> Result {
9+
todo!()
10+
}
11+
}
12+
13+
#[quint_run(spec = "spec.qnt", max_samples = -666)]
14+
fn test1() -> impl Driver {
15+
TestDriver
16+
}
17+
18+
#[quint_run(spec = "spec.qnt", max_samples = "666")]
19+
fn test1() -> impl Driver {
20+
TestDriver
21+
}
22+
23+
fn main() {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error: invalid digit found in string
2+
--> tests/macros/quint_run/fail/stable/invalid_num.rs:13:46
3+
|
4+
13 | #[quint_run(spec = "spec.qnt", max_samples = -666)]
5+
| ^
6+
7+
error: expected integer literal
8+
--> tests/macros/quint_run/fail/stable/invalid_num.rs:18:46
9+
|
10+
18 | #[quint_run(spec = "spec.qnt", max_samples = "666")]
11+
| ^^^^^

connect/tests/macros/quint_test/fail/invalid_num.rs renamed to connect/tests/macros/quint_test/fail/nightly/invalid_num.rs

File renamed without changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error: invalid digit found in string
2+
--> tests/macros/quint_test/fail/nightly/invalid_num.rs:13:47
3+
|
4+
13 | #[quint_test(spec = "spec.qnt", max_samples = -666)]
5+
| ^^^^
6+
7+
error: expected integer literal
8+
--> tests/macros/quint_test/fail/nightly/invalid_num.rs:18:47
9+
|
10+
18 | #[quint_test(spec = "spec.qnt", max_samples = "666")]
11+
| ^^^^^

0 commit comments

Comments
 (0)