forked from eupn/macrotest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: Minimal reproducible issue eupn#74
Signed-off-by: Mark Van de Vyver <[email protected]>
- Loading branch information
1 parent
730f13f
commit a39a753
Showing
8 changed files
with
90 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
use super::IntegrationTest; | ||
use crate::tests::IntegrationTest; | ||
|
||
fn basic_test() { | ||
println!("Running basic test") | ||
println!("Running basic test") | ||
} | ||
|
||
inventory::submit!(IntegrationTest { | ||
name: "basic", | ||
test_fn: basic_test | ||
name: "basic", | ||
test_fn: basic_test | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
use crate::tests::IntegrationTest; | ||
|
||
fn feature_test() { | ||
println!("Running feature test") | ||
} | ||
|
||
inventory::submit!(IntegrationTest { | ||
name: "feature", | ||
test_fn: feature_test | ||
}); | ||
|
||
pub fn pass_args() { | ||
macrotest::expand_args( | ||
"integration/tests/feature/expanded/*.rs", | ||
&["--features", "test-feature"], | ||
); | ||
} | ||
inventory::submit!(IntegrationTest { | ||
name: "feature", | ||
test_fn: pass_args | ||
}); | ||
|
||
pub fn pass_expect_expanded_args() { | ||
// If you delete one of the `.expanded.rs` files, this test will fail. | ||
macrotest::expand_args( | ||
"integration/tests/feature/expanded/*.rs", | ||
&["--features", "test-feature"], | ||
); | ||
} | ||
inventory::submit!(IntegrationTest { | ||
name: "feature", | ||
test_fn: feature_test | ||
}); | ||
|
||
// Suspended panicky tests for the moment | ||
// | ||
// pub fn fail_expect_expanded_args() { | ||
// // This directory doesn't have expanded files but since they're expected, the test will fail. | ||
// macrotest::expand_without_refresh_args( | ||
// "integration/tests/feature/unchanged/*.rs", | ||
// &["--features", "test-feature"], | ||
// ); | ||
// } | ||
// inventory::submit!(IntegrationTest { | ||
// name: "feature", | ||
// test_fn: fail_expect_expanded_args | ||
// }); |
12 changes: 12 additions & 0 deletions
12
test-virtual/wrkspc-test/integration/tests/feature/expanded/with_args.expanded.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
extern crate std; | ||
#[macro_use] | ||
extern crate test_project; | ||
pub fn main() { | ||
{ | ||
let mut temp_vec = Vec::new(); | ||
temp_vec.push(1); | ||
temp_vec.push(2); | ||
temp_vec.push(3); | ||
temp_vec | ||
}; | ||
} |
8 changes: 8 additions & 0 deletions
8
test-virtual/wrkspc-test/integration/tests/feature/expanded/with_args.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#![cfg(feature = "test-feature")] | ||
|
||
#[macro_use] | ||
extern crate test_project; | ||
|
||
pub fn main() { | ||
test_feature_vec![1, 2, 3]; | ||
} |
8 changes: 8 additions & 0 deletions
8
test-virtual/wrkspc-test/integration/tests/feature/unchanged/with_args.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#![cfg(feature = "test-feature")] | ||
|
||
#[macro_use] | ||
extern crate test_project; | ||
|
||
pub fn main() { | ||
test_feature_vec![1, 2, 3]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod basic; | ||
pub mod feature; | ||
|
||
#[derive(Debug)] | ||
pub struct IntegrationTest { | ||
|