Skip to content

Commit 7626af2

Browse files
committed
tests and some functionality
1 parent 5fd0cf7 commit 7626af2

File tree

6 files changed

+324
-187
lines changed

6 files changed

+324
-187
lines changed

examples/simple.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,12 @@ async fn main() -> Result<(), Box<dyn Error>> {
4848
dbg!(&compile_output);
4949

5050
if let Some(compile_output) = compile_output {
51-
eprintln!("STDOUT:\n{}", compile_output.stdout.to_str_lossy());
52-
eprintln!("STDERR:\n{}", compile_output.stderr.to_str_lossy());
53-
eprintln!("STATUS: {}", compile_output.status);
51+
eprintln!("STDOUT:\n{}", compile_output.stdout().to_str_lossy());
52+
eprintln!("STDERR:\n{}", compile_output.stderr().to_str_lossy());
53+
eprintln!("STATUS: {}", compile_output.exit_status());
5454
}
5555

56-
while let Some(test) = tests.wait_next().await {
57-
let test = test.unwrap();
56+
while let Some(test) = tests.wait_next().await? {
5857
info!("tests[{}] = {:?}", test.index(), test);
5958
}
6059

src/context/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub struct TestContextBuilder<Tests, RunCmd, T: 'static = ()> {
3737
}
3838

3939
impl<T> TestContextBuilder<MissingTests, MissingRunCmd, T> {
40-
pub fn new() -> Self {
40+
pub(crate) fn new() -> Self {
4141
Self {
4242
trim_output: true,
4343
test_cases: Vec::new(),

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ impl SimpleOutput {
8888
status,
8989
}
9090
}
91+
92+
pub fn success(&self) -> bool {
93+
self.status != 0
94+
}
9195
}
9296

9397
impl Default for SimpleOutput {

0 commit comments

Comments
 (0)