Skip to content

Commit accf8cd

Browse files
committed
Add: Basic test - green
Correctly produces: Setup Running basic test Teardown Signed-off-by: Mark Van de Vyver <[email protected]>
1 parent 89a5b22 commit accf8cd

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
pub mod tests;
22

3+
use tests::IntegrationTest;
4+
35
fn setup() {
46
println!("Setup")
57
}
@@ -11,7 +13,10 @@ fn main() {
1113
// Setup test environment
1214
setup();
1315

14-
// TODO: Run the test
16+
// Run the tests
17+
for t in inventory::iter::<IntegrationTest> {
18+
(t.test_fn)()
19+
}
1520

1621
// Teardown test environment
1722
teardown();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use super::IntegrationTest;
2+
3+
fn basic_test() {
4+
println!("Running basic test")
5+
}
6+
7+
inventory::submit!(IntegrationTest {
8+
name: "basic",
9+
test_fn: basic_test
10+
});

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

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
pub mod basic;
2+
13
#[derive(Debug)]
24
pub struct IntegrationTest {
35
pub name: &'static str,

0 commit comments

Comments
 (0)