Skip to content

Commit

Permalink
add bench test
Browse files Browse the repository at this point in the history
  • Loading branch information
bend-n committed Oct 9, 2023
1 parent 50b413c commit 60f783d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/libtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub enum SuiteEvent {
failed: usize,
/// number of tests that were ignored
ignored: usize,
/// i think its something to do with benchmarks?
/// number of benchmarks run
measured: usize,
/// i think this is based on what you specify in the cargo test argument
filtered_out: usize,
Expand Down Expand Up @@ -145,9 +145,11 @@ fn deser() {
];

run![
r#"{ "type": "suite", "event": "started", "test_count": 1 }"# parses to TestMessage::Suite(SuiteEvent::Started { test_count: 1 }),
r#"{ "type": "suite", "event": "started", "test_count": 2 }"# parses to TestMessage::Suite(SuiteEvent::Started { test_count: 2 }),
r#"{ "type": "test", "event": "started", "name": "fail" }"# parses to TestMessage::Test(TestEvent::Started { name: "fail".into() }),
r#"{ "type": "test", "event": "started", "name": "benc" }"# parses to TestMessage::Test(TestEvent::Started { name: "benc".into() }),
r#"{ "type": "bench", "name": "benc", "median": 0, "deviation": 0 }"# parses to TestMessage::Bench { name: "benc".into(), median: 0., deviation: 0., mib_per_second: None },
r#"{ "type": "test", "name": "fail", "event": "failed", "exec_time": 0.000081092, "stdout": "thread 'fail' panicked" }"# parses to TestMessage::Test(TestEvent::Failed { name: "fail".into(), exec_time: 0.000081092, stdout: Some("thread 'fail' panicked".into()), reason: None, message: None} ),
r#"{ "type": "suite", "event": "failed", "passed": 0, "failed": 1, "ignored": 0, "measured": 0, "filtered_out": 0, "exec_time": 0.000731068 }"# parses to TestMessage::Suite(SuiteEvent::Failed { passed: 0, failed: 1, ignored: 0, measured: 0, filtered_out: 0, exec_time: 0.000731068 })
r#"{ "type": "suite", "event": "failed", "passed": 0, "failed": 1, "ignored": 0, "measured": 1, "filtered_out": 0, "exec_time": 0.000731068 }"# parses to TestMessage::Suite(SuiteEvent::Failed { passed: 0, failed: 1, ignored: 0, measured: 1, filtered_out: 0, exec_time: 0.000731068 })
];
}

0 comments on commit 60f783d

Please sign in to comment.