forked from FuelLabs/sway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
34 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,22 @@ | ||
mod e2e_vm_tests; | ||
mod ir_generation; | ||
|
||
fn main() { | ||
let mut locked = false; | ||
let mut filter_regex = None; | ||
for arg in std::env::args().skip(1) { | ||
// Check for the `--locked` flag. Must precede the regex. | ||
// Intended for use in `CI` to ensure test lock files are up to date. | ||
if arg == "--locked" { | ||
locked = true; | ||
continue; | ||
} | ||
use clap::Parser; | ||
|
||
#[derive(Parser)] | ||
struct Cli { | ||
/// If specified, only run tests matching this regex | ||
#[clap(value_parser)] | ||
filter_regex: Option<regex::Regex>, | ||
|
||
// Check for a regex, used to filter the set of tests. | ||
let regex = regex::Regex::new(&arg).unwrap_or_else(|_| { | ||
panic!( | ||
"Expected either `--locked` or a filter regex, found: {:?}.", | ||
arg | ||
) | ||
}); | ||
filter_regex = Some(regex); | ||
} | ||
/// Intended for use in `CI` to ensure test lock files are up to date | ||
#[clap(long)] | ||
locked: bool, | ||
} | ||
|
||
fn main() { | ||
let cli = Cli::parse(); | ||
|
||
e2e_vm_tests::run(locked, filter_regex.as_ref()); | ||
ir_generation::run(filter_regex.as_ref()); | ||
e2e_vm_tests::run(cli.locked, cli.filter_regex.as_ref()); | ||
ir_generation::run(cli.filter_regex.as_ref()); | ||
} |