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

Fix codegen-units tests that were disabled 8 years ago #128929

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

saethlin
Copy link
Member

@saethlin saethlin commented Aug 10, 2024

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.

@rustbot
Copy link
Collaborator

rustbot commented Aug 10, 2024

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 10, 2024
@compiler-errors
Copy link
Member

Yep, doesn't hurt to have these

r=me when green

@rust-log-analyzer

This comment has been minimized.

@saethlin saethlin force-pushed the enable-codegen-units-tests branch from abada33 to 1e4a02e Compare August 10, 2024 17:33
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Aug 10, 2024
@rustbot
Copy link
Collaborator

rustbot commented Aug 10, 2024

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@rust-log-analyzer

This comment has been minimized.

@saethlin saethlin force-pushed the enable-codegen-units-tests branch from 1e4a02e to 03b6c2f Compare August 10, 2024 18:03
@saethlin
Copy link
Member Author

@compiler-errors @jieyouxu I've added new normalization logic to compiletest to get the tests to pass. I'd appreciate a re-review.

Copy link
Member

@compiler-errors compiler-errors left a 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...

@compiler-errors
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Aug 10, 2024

📌 Commit 03b6c2f has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 10, 2024
Comment on lines +3037 to +3039
.map(|line| {
line.replace(&self.testpaths.file.display().to_string(), "TEST_PATH").to_string()
})
Copy link
Member

@jieyouxu jieyouxu Aug 11, 2024

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?

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.

Copy link
Member

@jieyouxu jieyouxu Aug 11, 2024

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)

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@jieyouxu jieyouxu left a 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!

jieyouxu added a commit to jieyouxu/rust that referenced this pull request Aug 11, 2024
…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.
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Aug 11, 2024
…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.
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 11, 2024
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
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 12, 2024
…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.
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 12, 2024
…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
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 12, 2024
…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
@bors bors merged commit 5b6379a into rust-lang:master Aug 12, 2024
6 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Aug 12, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 12, 2024
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.
@saethlin saethlin deleted the enable-codegen-units-tests branch August 12, 2024 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants