Skip to content

make revisions in the test harness show up as independent tests #47604

Closed
@nikomatsakis

Description

@nikomatsakis

So @spastorino recently hacked up a test to include two revisions, one of which enables NLL, by adding:

// revisions: lexical nll
#![cfg_attr(nll, feature(nll))]

This generates the following output:

running 1 test
test [run-pass] run-pass/generator/yield-subtype.rs ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 2883 filtered out

at which point the question is -- did both of those revisions really run successfully?

Currently, if a test has N revisions, we run them all as part of its "main line". It'd be more reassuring if we made the revision part of the test name, so that you get output like:

running 2 tests
test [run-pass] run-pass/generator/yield-subtype.rs#nonlexical ... ok
test [run-pass] run-pass/generator/yield-subtype.rs#nll ... ok

The "early properties" of a test (which are gathered while we are assembling the list of tests) already contains the list of revisions:

pub revisions: Vec<String>,

Therefore, it should be a relatively simple thing to extend the make_test function to return not one test, but potentially many tests (one for each revision):

pub fn make_test(config: &Config, testpaths: &TestPaths) -> test::TestDescAndFn {

We would of course have to modify the test description to include which revision to run, and modify the run function, since that is the one that currently iterates over the list of revisions:

if base_props.revisions.is_empty() {
base_cx.run_revision()
} else {
for revision in &base_props.revisions {
let revision_props = TestProps::from_file(&testpaths.file, Some(revision), &config);
let rev_cx = TestCx {
config: &config,
props: &revision_props,
testpaths,
revision: Some(revision),
};
rev_cx.run_revision();
}
}

But this shouldn't be a big change, I wouldn't think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-testsuiteArea: The testsuite used to check the correctness of rustcC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions