Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
feat: failure exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
llenotre committed Jun 10, 2024
1 parent c05c00e commit 4d3ec56
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#![feature(io_error_more)]

use crate::util::{exec, TestResult};
use std::process::exit;
use std::process::Command;

mod filesystem;
Expand Down Expand Up @@ -124,6 +125,7 @@ fn main() {
// Start marker
println!();
println!("[START]");
let mut failure = false;
for suite in TESTS {
println!("[SUITE] {}", suite.name);
println!("[DESC] {}", suite.desc);
Expand All @@ -133,10 +135,16 @@ fn main() {
let res = (test.start)();
match res {
Ok(_) => println!("[OK]"),
Err(err) => println!("[KO] {}", err.0),
Err(err) => {
failure = true;
println!("[KO] {}", err.0);
}
}
}
}
// End marker
println!("[END]");
if failure {
exit(1);
}
}

0 comments on commit 4d3ec56

Please sign in to comment.