Skip to content

Commit

Permalink
[datatest-stable] handle the --ignored flag
Browse files Browse the repository at this point in the history
The new test runner tries to list these out, and malfunctions because
the full set of tests is printed out as both ignored and non-ignored
tests.
  • Loading branch information
sunshowers authored and bors-libra committed Mar 26, 2021
1 parent 5a18d9d commit 7b1cc87
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions common/datatest-stable/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ struct TestOpts {
/// List all tests
list: bool,
#[structopt(long)]
/// NO-OP: unsupported option, exists for compatibility with the default test harness
/// List or run ignored tests (always empty: it is currently not possible to mark tests as
/// ignored)
ignored: bool,
#[structopt(long)]
/// NO-OP: unsupported option, exists for compatibility with the default test harness
Expand Down Expand Up @@ -100,7 +101,13 @@ impl Default for Format {
pub fn runner(reqs: &[Requirements]) {
let options = TestOpts::from_args();

let tests: Vec<Test> = reqs.iter().flat_map(|req| req.expand()).collect();
let tests: Vec<Test> = if options.ignored {
// Currently impossible to mark tests as ignored.
// TODO: add support for this in the future, probably by supporting an "ignored" dir
vec![]
} else {
reqs.iter().flat_map(|req| req.expand()).collect()
};

if options.list {
for test in &tests {
Expand Down

0 comments on commit 7b1cc87

Please sign in to comment.