1 //! Module containing different events that can occur 2 //! during tests execution process. 3 4 use super::test_result::TestResult; 5 use super::time::TestExecTime; 6 use super::types::{TestDesc, TestId}; 7 8 #[derive(Debug, Clone)] 9 pub struct CompletedTest { 10 pub id: TestId, 11 pub desc: TestDesc, 12 pub result: TestResult, 13 pub exec_time: Option<TestExecTime>, 14 pub stdout: Vec<u8>, 15 } 16 17 impl CompletedTest { new( id: TestId, desc: TestDesc, result: TestResult, exec_time: Option<TestExecTime>, stdout: Vec<u8>, ) -> Self18 pub fn new( 19 id: TestId, 20 desc: TestDesc, 21 result: TestResult, 22 exec_time: Option<TestExecTime>, 23 stdout: Vec<u8>, 24 ) -> Self { 25 Self { id, desc, result, exec_time, stdout } 26 } 27 } 28 29 #[derive(Debug, Clone)] 30 pub enum TestEvent { 31 TeFiltered(usize, Option<u64>), 32 TeWait(TestDesc), 33 TeResult(CompletedTest), 34 TeTimeout(TestDesc), 35 TeFilteredOut(usize), 36 } 37