Skip to main content

test_init

Macro test_init 

Source
macro_rules! test_init {
    ($start_id:expr) => { ... };
}
Expand description

Initialise the logging system for tests

Install the logger that will capture all log messages. This is done by setting the default logging level to Trace and installing a logger that records all log messages to a global string.

Note: this is called test_init because macros are exported at the root of the crate.

§Arguments

  • start_id - The ID value to be set as the starting value

§Examples

use gwr_track::test_helpers;
use serial_test::serial;

#[test]
fn smoke() {
    let (test_tracker, tracker) = gwr_track::test_init!(10);
    let top = gwr_track::entity::toplevel(&tracker, "top");
    test_helpers::check_and_clear(&test_tracker, &["10: top created"]);
}