Add --match-tests to 'check' cmd

For running only tests matching a certain pattern. Useful when doing TDD.
This commit is contained in:
KtorZ
2022-12-13 16:00:29 +01:00
committed by Lucas
parent 0d891daac8
commit 1637a0d30e
3 changed files with 23 additions and 8 deletions

View File

@@ -10,13 +10,18 @@ pub struct Args {
/// Skip tests; run only the type-checker
#[clap(short, long)]
skip_tests: bool,
/// Only run tests if their path + name match the given string
#[clap(short, long)]
match_tests: Option<String>,
}
pub fn exec(
Args {
directory,
skip_tests,
match_tests,
}: Args,
) -> miette::Result<()> {
crate::with_project(directory, |p| p.check(skip_tests))
crate::with_project(directory, |p| p.check(skip_tests, match_tests.clone()))
}