Skip to content

Commit 55e599a

Browse files
committed
Add: Minimal reproducible issue eupn#74
Signed-off-by: Mark Van de Vyver <[email protected]>
1 parent accf8cd commit 55e599a

File tree

8 files changed

+90
-4
lines changed

8 files changed

+90
-4
lines changed

test-virtual/wrkspc-test/Cargo.toml

+6
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,9 @@ inventory = "0.2.2"
1919
name = "integration-tests"
2020
path = "integration/main.rs"
2121
harness = false
22+
23+
[[test]]
24+
name = "defaults-indev-tokio"
25+
path = "integration/feature.rs"
26+
harness = false
27+
required-features = ["test-feature"]

test-virtual/wrkspc-test/integration/main.rs

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ fn setup() {
99
fn teardown() {
1010
println!("Teardown")
1111
}
12+
// NOTE:
13+
// When this code is in src/main.rs, it is executed by `cargo test -- --list`.
14+
// In such cases you could guard it:
15+
// #[cfg(feature = "integration")]
1216
fn main() {
1317
// Setup test environment
1418
setup();
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use super::IntegrationTest;
1+
use crate::tests::IntegrationTest;
22

33
fn basic_test() {
4-
println!("Running basic test")
4+
println!("Running basic test")
55
}
66

77
inventory::submit!(IntegrationTest {
8-
name: "basic",
9-
test_fn: basic_test
8+
name: "basic",
9+
test_fn: basic_test
1010
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
use crate::tests::IntegrationTest;
2+
3+
fn feature_test() {
4+
println!("Running feature test")
5+
}
6+
7+
inventory::submit!(IntegrationTest {
8+
name: "feature",
9+
test_fn: feature_test
10+
});
11+
12+
pub fn pass_args() {
13+
macrotest::expand_args(
14+
"integration/tests/feature/expanded/*.rs",
15+
&["--features", "test-feature"],
16+
);
17+
}
18+
inventory::submit!(IntegrationTest {
19+
name: "feature",
20+
test_fn: pass_args
21+
});
22+
23+
pub fn pass_expect_expanded_args() {
24+
// If you delete one of the `.expanded.rs` files, this test will fail.
25+
macrotest::expand_args(
26+
"integration/tests/feature/expanded/*.rs",
27+
&["--features", "test-feature"],
28+
);
29+
}
30+
inventory::submit!(IntegrationTest {
31+
name: "feature",
32+
test_fn: feature_test
33+
});
34+
35+
// Suspended panicky tests for the moment
36+
//
37+
// pub fn fail_expect_expanded_args() {
38+
// // This directory doesn't have expanded files but since they're expected, the test will fail.
39+
// macrotest::expand_without_refresh_args(
40+
// "integration/tests/feature/unchanged/*.rs",
41+
// &["--features", "test-feature"],
42+
// );
43+
// }
44+
// inventory::submit!(IntegrationTest {
45+
// name: "feature",
46+
// test_fn: fail_expect_expanded_args
47+
// });
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extern crate std;
2+
#[macro_use]
3+
extern crate test_project;
4+
pub fn main() {
5+
{
6+
let mut temp_vec = Vec::new();
7+
temp_vec.push(1);
8+
temp_vec.push(2);
9+
temp_vec.push(3);
10+
temp_vec
11+
};
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#![cfg(feature = "test-feature")]
2+
3+
#[macro_use]
4+
extern crate test_project;
5+
6+
pub fn main() {
7+
test_feature_vec![1, 2, 3];
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#![cfg(feature = "test-feature")]
2+
3+
#[macro_use]
4+
extern crate test_project;
5+
6+
pub fn main() {
7+
test_feature_vec![1, 2, 3];
8+
}

test-virtual/wrkspc-test/integration/tests/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
pub mod basic;
2+
pub mod feature;
23

34
#[derive(Debug)]
45
pub struct IntegrationTest {

0 commit comments

Comments
 (0)