event.rs.html -- source
Description: Source to the Rust file `src/libtest/event.rs`.
Keywords: rust, rustlang, rust-lang

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41

    //! Module containing different events that can occur
    //! during tests execution process.

    use super::types::TestDesc;
    use super::test_result::TestResult;
    use super::time::TestExecTime;

    #[derive(Debug, Clone)]
    pub struct CompletedTest {
        pub desc: TestDesc,
        pub result: TestResult,
        pub exec_time: Option<TestExecTime>,
        pub stdout: Vec<u8>,
    }

    impl CompletedTest {
        pub fn new(
            desc: TestDesc,
            result: TestResult,
            exec_time: Option<TestExecTime>,
            stdout: Vec<u8>
        ) -> Self {
            Self {
                desc,
                result,
                exec_time,
                stdout,
            }
        }
    }

    unsafe impl Send for CompletedTest {}

    #[derive(Debug, Clone)]
    pub enum TestEvent {
        TeFiltered(Vec<TestDesc>),
        TeWait(TestDesc),
        TeResult(CompletedTest),
        TeTimeout(TestDesc),
        TeFilteredOut(usize),
    }