pub struct TestResult {
pub execution: TestExecution,
pub status: TestStatus,
pub generated_files: Vec<PathBuf>,
pub mismatches: Vec<GoldenMismatch>,
pub logs: String,
pub error: Option<String>,
}Expand description
Complete test result with outcome
Fields§
§execution: TestExecutionExecution metadata
status: TestStatusTest status/outcome
generated_files: Vec<PathBuf>Files generated by ggen sync
mismatches: Vec<GoldenMismatch>Golden file mismatches (if any)
logs: StringCaptured stdout/stderr
error: Option<String>Error message (if failed)
Implementations§
Source§impl TestResult
impl TestResult
Sourcepub fn passed(execution: TestExecution, files: Vec<PathBuf>) -> Self
pub fn passed(execution: TestExecution, files: Vec<PathBuf>) -> Self
Create a passing test result
Sourcepub fn failed(execution: TestExecution, error: String, logs: String) -> Self
pub fn failed(execution: TestExecution, error: String, logs: String) -> Self
Create a failing test result
Sourcepub fn timed_out(
execution: TestExecution,
timeout: Duration,
logs: String,
) -> Self
pub fn timed_out( execution: TestExecution, timeout: Duration, logs: String, ) -> Self
Create a timed out test result
Sourcepub fn skipped(execution: TestExecution, reason: String) -> Self
pub fn skipped(execution: TestExecution, reason: String) -> Self
Create a skipped test result
Sourcepub fn add_mismatch(&mut self, mismatch: GoldenMismatch)
pub fn add_mismatch(&mut self, mismatch: GoldenMismatch)
Add a golden file mismatch
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if test passed
Sourcepub fn to_junit_xml(&self) -> String
pub fn to_junit_xml(&self) -> String
Generate JUnit XML representation
Trait Implementations§
Source§impl Debug for TestResult
impl Debug for TestResult
Auto Trait Implementations§
impl Freeze for TestResult
impl RefUnwindSafe for TestResult
impl Send for TestResult
impl Sync for TestResult
impl Unpin for TestResult
impl UnwindSafe for TestResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more