Skip to content

Commit

Permalink
Do not exit when tests run
Browse files Browse the repository at this point in the history
Signed-off-by: itowlson <[email protected]>
  • Loading branch information
itowlson committed Oct 7, 2024
1 parent ac3a6f2 commit b36caf7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/conformance-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ impl Config {
}
}

/// Run the conformance tests
/// Run the conformance tests and return the results.
pub fn run_tests(
config: Config,
run: impl Fn(Test) -> anyhow::Result<()> + Send + Clone + 'static,
) -> anyhow::Result<()> {
) -> anyhow::Result<libtest_mimic::Conclusion> {
let tests_dir = download_tests(&config.version)?;
run_tests_from(tests_dir, config, run)
}

/// Run the conformance tests located in the given directory
/// Run the conformance tests located in the given directory and returns the Conclusion
pub fn run_tests_from(
tests_dir: impl AsRef<Path>,
config: Config,
run: impl Fn(Test) -> anyhow::Result<()> + Send + Clone + 'static,
) -> anyhow::Result<()> {
) -> anyhow::Result<libtest_mimic::Conclusion> {
let trials = tests_iter(tests_dir)?
.map(|test| {
let run = run.clone();
Expand All @@ -56,7 +56,7 @@ pub fn run_tests_from(
.with_ignored_flag(config.ignored.contains(&name))
})
.collect();
libtest_mimic::run(&Default::default(), trials).exit();
Ok(libtest_mimic::run(&Default::default(), trials))
}

/// Download the conformance tests and return the path to the directory where they are written to
Expand Down

0 comments on commit b36caf7

Please sign in to comment.