Skip to content

Commit

Permalink
Make filtering expression experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
Guiguiprim committed Apr 3, 2022
1 parent 84ef4eb commit a944c2a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cargo-nextest/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,19 @@ struct App {
config_opts: ConfigOpts,
}

fn check_experimental_filtering(build_filter: &TestBuildFilter) -> Result<()> {
const EXPERIMENTAL_ENV: &str = "NEXTEST_EXPERIMENTAL_EXPR_FILTER";
let enabled = std::env::var(EXPERIMENTAL_ENV).is_ok();
if !build_filter.expr_filter.is_empty() && !enabled {
Err(Report::new(ExpectedError::experimental_feature_error(
"expression filtering",
EXPERIMENTAL_ENV,
)))
} else {
Ok(())
}
}

impl App {
fn new(
output: OutputOpts,
Expand All @@ -490,6 +503,7 @@ impl App {
) -> Result<Self> {
let output = output.init();
reuse_build.check_experimental(output)?;
check_experimental_filtering(&build_filter)?;

let graph_data = match reuse_build.cargo_metadata.as_deref() {
Some(path) => std::fs::read_to_string(path)?,
Expand Down

0 comments on commit a944c2a

Please sign in to comment.