Skip to content

Commit

Permalink
Introduce filter expression and its parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Guiguiprim committed Mar 21, 2022
1 parent 0bdbec9 commit 615ea42
Show file tree
Hide file tree
Showing 4 changed files with 532 additions and 1 deletion.
136 changes: 135 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions nextest-runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ documentation = "https://docs.rs/nextest-runner"
edition = "2018"
rust-version = "1.54"

[features]
default = []
# Must be called `trace` which is a bit infortunate
trace = ["nom-tracable/trace"]

[dependencies]
aho-corasick = "0.7.18"
camino = { version = "1.0.7", features = ["serde1"] }
Expand All @@ -27,8 +32,13 @@ humantime-serde = "1.1.1"
indent_write = "2.2.0"
once_cell = "1.10.0"
owo-colors = "3.2.0"
miette = "4.2.1"
nom = "7.1.1"
nom_locate = "4.0.0"
nom-tracable = "0.8.0"
num_cpus = "1.13.1"
rayon = "1.5.1"
regex = "1.5.5"
serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1.0.79"
strip-ansi-escapes = "0.1.1"
Expand Down
12 changes: 12 additions & 0 deletions nextest-runner/src/test_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ use aho_corasick::AhoCorasick;
use nextest_metadata::{FilterMatch, MismatchReason};
use std::{fmt, str::FromStr};

mod expression;

/// Whether to run ignored tests.
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum RunIgnored {
Expand Down Expand Up @@ -197,6 +199,16 @@ impl<'filter> TestFilter<'filter> {
_test_name: &str,
) -> Option<FilterMatch> {
// TODO filter using self.expr

// DSL ?
// - package(name)
// - deps(package_name)
// - rdeps(package_name)
// - test(partial_name)
// - not(expr)
// - && / and
// - || / or
// - ()
None
}

Expand Down
Loading

0 comments on commit 615ea42

Please sign in to comment.