summaryrefslogtreecommitdiffstats
path: root/library/test/src/event.rs
blob: 80281ebd2d4cdd946207f67bf741f10cb0d94e58 (plain)
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
//! Module containing different events that can occur
//! during tests execution process.

use super::test_result::TestResult;
use super::time::TestExecTime;
use super::types::{TestDesc, TestId};

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

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

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