Skip to content

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Oct 13, 2024

A build-fail test requires that a check build (roughly --emit=metadata, no codegen) succeeds but fails later. Previously, if its check build failed, the user will see the error message

error: test compilation failed although it shouldn't!

which is confusing. Because the test is build-fail, we want the test compilation to fail! This error message doesn't account for the difference between a check build and a complete build, so let's special case the error message for a build-fail test whose check build failed to instead say

error: `build-fail` test is required to pass check build, but check build failed

Fixes #130894.

@jieyouxu jieyouxu added the A-compiletest Area: The compiletest test runner label Oct 13, 2024
@rustbot

This comment was marked as resolved.

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Oct 13, 2024
@jieyouxu

This comment was marked as resolved.

@jieyouxu
Copy link
Member Author

r? bootstrap (Mark has a ton of assigned PRs)

@jieyouxu
Copy link
Member Author

cc @RalfJung and @asquared31415 does this error message make more sense to you?

@RalfJung
Copy link
Member

error: build-fail test is required to pass check build, but check build failed

That sounds great :)

@Kobzol
Copy link
Member

Kobzol commented Oct 13, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 13, 2024

📌 Commit 40ca4d8 has been approved by Kobzol

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 Oct 13, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 13, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#131086 (Update unicode-width to 0.2.0)
 - rust-lang#131585 (compiletest: Remove the one thing that was checking a directive's `original_line`)
 - rust-lang#131614 (Error on trying to use revisions in `run-make` tests)
 - rust-lang#131638 (compiletest: Move debugger setup code out of `lib.rs`)
 - rust-lang#131641 (switch unicode-data bitsets back to 'static')
 - rust-lang#131642 (Special case error message for a `build-fail` test that failed check build)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0fa7101 into rust-lang:master Oct 13, 2024
6 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 13, 2024
Rollup merge of rust-lang#131642 - jieyouxu:build-fail-check-fail, r=Kobzol

Special case error message for a `build-fail` test that failed check build

A `build-fail` test requires that a check build (roughly `--emit=metadata`, no codegen) succeeds but fails later. Previously, if its check build failed, the user will see the error message

```
error: test compilation failed although it shouldn't!
```

which is confusing. Because the test is `build-fail`, we want the test compilation to fail! This error message doesn't account for the difference between a check build and a complete build, so let's special case the error message for a `build-fail` test whose check build failed to instead say

```
error: `build-fail` test is required to pass check build, but check build failed
```

Fixes rust-lang#130894.
@rustbot rustbot added this to the 1.83.0 milestone Oct 13, 2024
@jieyouxu jieyouxu deleted the build-fail-check-fail branch October 13, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner 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
No open projects
Development

Successfully merging this pull request may close these issues.

compiletest shows very confusing error when a "build-fail" test fails the check part
8 participants