/// Suite related event #[derive(Debug, PartialEq, Deserialize, Serialize)] #[serde(tag = "event")] #[serde(rename_all = "lowercase")] /// Suite event pubenum SuiteEvent { /// emitted on the start of a test run, and the start of the doctests
Started { /// number of tests in this suite
test_count: usize,
}, /// the suite has finished
Ok { /// the number of tests that passed
passed: usize, /// the number of tests that failed
failed: usize, /// number of tests that were ignored
ignored: usize, /// number of benchmarks run
measured: usize, /// i think this is based on what you specify in the cargo test argument
filtered_out: usize, /// how long the suite took to run
exec_time: f32,
}, /// the suite has at least one failing test
Failed { /// the number of tests that passed
passed: usize, /// the number of tests that failed
failed: usize, /// number of tests that were ignored
ignored: usize, /// i think its something to do with benchmarks?
measured: usize, /// i think this is based on what you specify in the cargo test argument
filtered_out: usize, /// how long the suite took to run
exec_time: f32,
},
}
#[derive(Debug, PartialEq, Deserialize, Serialize)] #[serde(tag = "event")] #[serde(rename_all = "lowercase")] /// Test event pubenum TestEvent { /// a new test starts
Started { /// the name of this test
name: String,
}, /// the test has finished
Ok { /// which one
name: String, /// in how long
exec_time: f32, /// what did it say?
stdout: Option<String>,
}, /// the test has failed
Failed { /// which one
name: String, /// in how long
exec_time: f32, /// why?
stdout: Option<String>, /// it timed out?
reason: Option<String>, /// what message
message: Option<String>,
}, /// the test has been ignored
Ignored { /// which one
name: String,
}, /// the test has timed out
Timeout { /// which one
name: String,
},
}
impl TestEvent { /// Get the name of this test pubfn name(&self) -> &str { let (Self::Started { name }
| Self::Ok { name, .. }
| Self::Ignored { name }
| Self::Failed { name, .. }
| Self::Timeout { name }) = self;
name
}
/// Get the stdout of this test, if available. pubfn stdout(&self) -> Option<&str> { matchself { Self::Ok { stdout, .. } | Self::Failed { stdout, .. } => stdout.as_deref(),
_ => None,
}
}
}
#[derive(Debug, PartialEq, Deserialize, Serialize)] /// Represents the output of `cargo test -- -Zunstable-options --report-time --show-output --format json`. /// /// requires --report-time /// /// # Stability /// /// As this struct is for interfacing with the unstable libtest json output, this struct may change at any time, without semver guarantees. #[serde(tag = "type")] #[serde(rename_all = "lowercase")] pubenum TestMessage { /// suite related message
Suite(SuiteEvent), /// test related message
Test(TestEvent), /// bench related message
Bench { /// name of benchmark
name: String, /// distribution
median: f32, /// deviation
deviation: f32, /// thruput in MiB per second
mib_per_second: Option<f32>,
},
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.