-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Fix codegen-units tests that were disabled 8 years ago #128929
Conversation
rustbot has assigned @Mark-Simulacrum. Use |
Yep, doesn't hurt to have these r=me when green |
This comment has been minimized.
This comment has been minimized.
abada33
to
1e4a02e
Compare
Some changes occurred in src/tools/compiletest cc @jieyouxu |
This comment has been minimized.
This comment has been minimized.
1e4a02e
to
03b6c2f
Compare
@compiler-errors @jieyouxu I've added new normalization logic to compiletest to get the tests to pass. I'd appreciate a re-review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kinda a hack but fine I guess. I wonder if we should be normalizing the test path in general in //~
strings -- IIRC we don't do it for diagnostics so people usually have to write //~ ERROR expected {closure@
and leave out the path part...
@bors r+ rollup |
.map(|line| { | ||
line.replace(&self.testpaths.file.display().to_string(), "TEST_PATH").to_string() | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussion (not blocking): I think this is fine for codegen-units
tests, but ui tests normalize paths in their output with placeholders like $SRC_DIR
, $DIR
, $COMPILER_DIR
. Should we follow that for consistency?
rust/src/tools/compiletest/src/runtest.rs
Lines 4322 to 4328 in 730d5d4
let base_dir = Path::new("/rustc/FAKE_PREFIX"); | |
// Paths into the libstd/libcore | |
normalize_path(&base_dir.join("library"), "$SRC_DIR"); | |
// `ui-fulldeps` tests can show paths to the compiler source when testing macros from | |
// `rustc_macros` | |
// eg. /home/user/rust/compiler | |
normalize_path(&base_dir.join("compiler"), "$COMPILER_DIR"); |
But AFAIK those are only applied when the diagnostic is --format json
or something. We probably also have other ways to do normalization for different test suites, it's a bit of a YOLO situation in here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(unrelated remark I need to breakup / tidy up runtest.rs
because the 4700 lines of run test logic is a pain every time I try to look up something)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. We should probably apply all the path normalizations to all tests to be honest. It can be hard to remember how little code sharing there is between test suites.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for trying to fix those tests!
…s, r=compiler-errors Fix codegen-units tests that were disabled 8 years ago I don't know if any of these tests still have value. They were disabled by rust-lang#33890, and we've survived without them for a while. But considering how small this test suite is, maybe it's worth having them. I also had to add some normalization to the codegen-units tests output. I think the fact that I had to add some underscores how poor our test coverage is.
…s, r=compiler-errors Fix codegen-units tests that were disabled 8 years ago I don't know if any of these tests still have value. They were disabled by rust-lang#33890, and we've survived without them for a while. But considering how small this test suite is, maybe it's worth having them. I also had to add some normalization to the codegen-units tests output. I think the fact that I had to add some underscores how poor our test coverage is.
Rollup of 5 pull requests Successful merges: - rust-lang#128643 (Refactor `powerpc64` call ABI handling) - rust-lang#128873 (Add windows-targets crate to std's sysroot) - rust-lang#128916 (Tidy up `dump-ice-to-disk` and make assertion failures dump ICE messages) - rust-lang#128929 (Fix codegen-units tests that were disabled 8 years ago) - rust-lang#128937 (Fix warnings in rmake tests on `x86_64-unknown-linux-gnu`) r? `@ghost` `@rustbot` modify labels: rollup
…s, r=compiler-errors Fix codegen-units tests that were disabled 8 years ago I don't know if any of these tests still have value. They were disabled by rust-lang#33890, and we've survived without them for a while. But considering how small this test suite is, maybe it's worth having them. I also had to add some normalization to the codegen-units tests output. I think the fact that I had to add some underscores how poor our test coverage is.
…llaumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#126245 (Greatly speed up doctests by compiling compatible doctests in one file) - rust-lang#128394 (Unify run button display with "copy code" button and with mdbook buttons) - rust-lang#128878 (Slightly refactor `Flags` in bootstrap) - rust-lang#128886 (Get rid of some `#[allow(rustc::untranslatable_diagnostic)]`) - rust-lang#128929 (Fix codegen-units tests that were disabled 8 years ago) - rust-lang#128967 (std::fs::get_path freebsd update.) - rust-lang#128978 (Use `assert_matches` around the compiler more) r? `@ghost` `@rustbot` modify labels: rollup
…llaumeGomez Rollup of 10 pull requests Successful merges: - rust-lang#128149 (nontemporal_store: make sure that the intrinsic is truly just a hint) - rust-lang#128394 (Unify run button display with "copy code" button and with mdbook buttons) - rust-lang#128537 (const vector passed through to codegen) - rust-lang#128632 (std: do not overwrite style in `get_backtrace_style`) - rust-lang#128878 (Slightly refactor `Flags` in bootstrap) - rust-lang#128886 (Get rid of some `#[allow(rustc::untranslatable_diagnostic)]`) - rust-lang#128929 (Fix codegen-units tests that were disabled 8 years ago) - rust-lang#128937 (Fix warnings in rmake tests on `x86_64-unknown-linux-gnu`) - rust-lang#128978 (Use `assert_matches` around the compiler more) - rust-lang#128994 (Fix bug in `Parser::look_ahead`.) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#128929 - saethlin:enable-codegen-units-tests, r=compiler-errors Fix codegen-units tests that were disabled 8 years ago I don't know if any of these tests still have value. They were disabled by rust-lang#33890, and we've survived without them for a while. But considering how small this test suite is, maybe it's worth having them. I also had to add some normalization to the codegen-units tests output. I think the fact that I had to add some underscores how poor our test coverage is.
I don't know if any of these tests still have value. They were disabled by #33890, and we've survived without them for a while. But considering how small this test suite is, maybe it's worth having them.
I also had to add some normalization to the codegen-units tests output. I think the fact that I had to add some underscores how poor our test coverage is.