1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
//! Events are send by the Runner to signal the progression in the test suite, with the results

use runner;
use example_result::ExampleResult;

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Event {
    StartRunner,
    FinishedRunner(runner::RunnerResult),
    StartDescribe(String),
    EndDescribe,
    StartTest(String),
    EndTest(ExampleResult), /* {Start,End}Before
                                   * {Start,End}After */
}

pub trait EventHandler {
    fn trigger(&mut self, event: &Event);
}