pub struct TestFilter { /* private fields */ }Expand description
Filter for selecting which tests to run.
Constructed via TestFilter::new.
Implementations§
Source§impl TestFilter
impl TestFilter
Sourcepub fn new(
mode: NextestRunMode,
run_ignored: RunIgnored,
patterns: TestFilterPatterns,
exprs: Vec<Filterset>,
) -> Result<Self, TestFilterBuildError>
pub fn new( mode: NextestRunMode, run_ignored: RunIgnored, patterns: TestFilterPatterns, exprs: Vec<Filterset>, ) -> Result<Self, TestFilterBuildError>
Creates a new TestFilter from the given patterns.
If an empty slice is passed, the test filter matches all possible test names.
Sourcepub fn filter_binary_match(
&self,
query: &BinaryQuery<'_>,
ecx: &EvalContext<'_>,
bound: FilterBound,
) -> FilterBinaryMatch
pub fn filter_binary_match( &self, query: &BinaryQuery<'_>, ecx: &EvalContext<'_>, bound: FilterBound, ) -> FilterBinaryMatch
Returns a value indicating whether this binary should or should not be run to obtain the list of tests within it.
Sourcepub fn default_set(mode: NextestRunMode, run_ignored: RunIgnored) -> Self
pub fn default_set(mode: NextestRunMode, run_ignored: RunIgnored) -> Self
Creates a new TestFilter that matches the default set of tests.
Sourcepub fn set_outstanding_tests(&mut self, rerun_info: ComputedRerunInfo)
pub fn set_outstanding_tests(&mut self, rerun_info: ComputedRerunInfo)
Sets the list of outstanding tests, if this is a rerun.
Sourcepub fn mode(&self) -> NextestRunMode
pub fn mode(&self) -> NextestRunMode
Returns the nextest execution mode.
Sourcepub fn patterns_eq(&self, other: &Self) -> bool
pub fn patterns_eq(&self, other: &Self) -> bool
Compares the patterns between two TestFilters.
Sourcepub fn has_group_predicates(&self) -> bool
pub fn has_group_predicates(&self) -> bool
Returns true if the filter expressions contain any group() predicates.
When true, test list creation must precompute group memberships.
Sourcepub fn into_rerun_info(self) -> Option<ComputedRerunInfo>
pub fn into_rerun_info(self) -> Option<ComputedRerunInfo>
Consumes self, returning the underlying ComputedRerunInfo if any.
Sourcepub fn filter_match(
&self,
binary_query: BinaryQuery<'_>,
test_name: &TestCaseName,
test_kind: &RustTestKind,
ecx: &EvalContext<'_>,
bound: FilterBound,
ignored: bool,
groups: Option<&dyn GroupLookup>,
) -> FilterMatch
pub fn filter_match( &self, binary_query: BinaryQuery<'_>, test_name: &TestCaseName, test_kind: &RustTestKind, ecx: &EvalContext<'_>, bound: FilterBound, ignored: bool, groups: Option<&dyn GroupLookup>, ) -> FilterMatch
Returns an enum describing the match status of this filter.
groups should be Some when the CLI filter contains group()
predicates, and None otherwise. When None, encountering a
group() predicate panics (it indicates a bug in filterset
compilation).
Trait Implementations§
Source§impl Clone for TestFilter
impl Clone for TestFilter
Source§fn clone(&self) -> TestFilter
fn clone(&self) -> TestFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TestFilter
impl RefUnwindSafe for TestFilter
impl Send for TestFilter
impl Sync for TestFilter
impl Unpin for TestFilter
impl UnwindSafe for TestFilter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more