Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiletest is misled by comments talking about src/test/run-pass/ dir #49860

Closed
pnkfelix opened this issue Apr 10, 2018 · 3 comments
Closed

Comments

@pnkfelix
Copy link
Member

Discovered while working on #48879

Due to #49855 I am forcing a number of tests without a // run-pass directive to explicitly always fall in any compilation mode.

I was surprised to discover one of the tests was emitting no errors but it wasn't one of the ones I had to force a failure on, and yet it was not tagged as // run-pass.

This was this test: https://github.com/rust-lang/rust/blob/master/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.rs

The problem is that this occurs on line 14 of the test:

// Compare to run-pass/issue-23338-params-outlive-temps-of-body.rs

which AFAICT is probably matching some regexp in compiletest e.g. like ^//.*run-pass.*$

@pnkfelix pnkfelix assigned pnkfelix and unassigned pnkfelix Apr 10, 2018
@pnkfelix pnkfelix changed the title compiletest: the // run-pass check is fooled by // stuff talking about run-pass/ dir compiletest is misled by comments talking about src/test/run-pass/ dir Apr 10, 2018
@varkor
Copy link
Member

varkor commented Apr 10, 2018

Seems slightly odd, because the tests for run-pass seem to check this correctly:

fn parse_run_pass(&self, line: &str) -> bool {
self.parse_name_directive(line, "run-pass")
}

fn parse_name_directive(&self, line: &str, directive: &str) -> bool {
// Ensure the directive is a whole word. Do not match "ignore-x86" when
// the line says "ignore-x86_64".
line.starts_with(directive) && match line.as_bytes().get(directive.len()) {
None | Some(&b' ') | Some(&b':') => true,
_ => false
}
}

And the check for the start of the line:
} else if ln.starts_with("//") {
it(ln[2..].trim_left());
}

@pnkfelix
Copy link
Member Author

Its possible that I misdiagnosed the reason that issue-23338-locals-die-before-temps-of-body.rs "worked" without adding #[rustc_error] in #49861

I'll try to dobule check.

@pnkfelix
Copy link
Member Author

Ah, I see: I think I misinterpreted what's happening in issue-23338-locals-die-before-temps-of-body.rs

Namely, the test isn't succeeding.

The compiler is ICE'ing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants