Skip to main content

ocelot_engine/
test_run_summary.rs

1use crate::failed_test_result::FailedTestResult;
2use ocelot_base::shared_string::SharedString;
3
4/// Summary of one `ocelot test` file execution.
5#[derive(Debug, Clone, PartialEq, Eq)]
6pub struct TestRunSummary {
7    pub passed: Vec<SharedString>,
8    pub failed: Vec<FailedTestResult>,
9}
10
11impl TestRunSummary {
12    /// Creates an empty summary.
13    pub fn new() -> Self {
14        Self {
15            passed: Vec::new(),
16            failed: Vec::new(),
17        }
18    }
19
20    /// Returns true when every discovered test passed.
21    pub fn is_success(&self) -> bool {
22        self.failed.is_empty()
23    }
24}
25
26impl Default for TestRunSummary {
27    fn default() -> Self {
28        Self::new()
29    }
30}