-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2. add module path 3. add start time 4. avoid destructoring for longer compatibility
- Loading branch information
Showing
6 changed files
with
90 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/// A test context. | ||
#[non_exhaustive] | ||
pub struct Context { | ||
/// The complete module test path | ||
pub module: &'static str, | ||
/// The complete test name | ||
pub name: &'static str, | ||
/// The optional test description | ||
pub description: Option<&'static str>, | ||
/// The optional case number | ||
pub case: Option<usize>, | ||
/// Start time | ||
pub start: std::time::Instant, | ||
} | ||
|
||
impl Context { | ||
pub fn new( | ||
module: &'static str, | ||
name: &'static str, | ||
description: Option<&'static str>, | ||
case: Option<usize>, | ||
) -> Self { | ||
Self { | ||
module, | ||
name, | ||
description, | ||
case, | ||
start: std::time::Instant::now(), | ||
} | ||
} | ||
} |
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
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