summaryrefslogtreecommitdiffstats
path: root/library/test/src/event.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/test/src/event.rs')
-rw-r--r--library/test/src/event.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/library/test/src/event.rs b/library/test/src/event.rs
new file mode 100644
index 000000000..6ff1a615e
--- /dev/null
+++ b/library/test/src/event.rs
@@ -0,0 +1,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(Vec<TestDesc>, Option<u64>),
+ TeWait(TestDesc),
+ TeResult(CompletedTest),
+ TeTimeout(TestDesc),
+ TeFilteredOut(usize),
+}