compiletest: Migrate from PassMode/FailMode to PassFailMode#156129
Open
Zalathar wants to merge 3 commits intorust-lang:mainfrom
Open
compiletest: Migrate from PassMode/FailMode to PassFailMode#156129Zalathar wants to merge 3 commits intorust-lang:mainfrom
PassMode/FailMode to PassFailMode#156129Zalathar wants to merge 3 commits intorust-lang:mainfrom
Conversation
This commit introduces `PassFailMode` as an internal detail of `TestProps`, but the full migration is left to a subsequent commit.
Collaborator
|
Some changes occurred in src/tools/compiletest cc @jieyouxu |
This comment has been minimized.
This comment has been minimized.
fmease
reviewed
May 4, 2026
| // exit code and actual run result in the failure message. | ||
| let pass_hint = format!("code={code:?} so test would pass with `{run_result}`"); | ||
| if self.should_run_successfully(pm) { | ||
| if pass_fail == PassFailMode::RunPass { |
Member
There was a problem hiding this comment.
This whole if/else chain can now be a nice match.
I have read
In order to focus on the main migration, I have mostly refrained from subsequent cleanups.
but IMO this would be a trivial improvement.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every UI test has an explicit or implicit “pass/fail mode” (e.g.
check-failorbuild-pass) that was historically stored in two separate optional fields (pass_modeandfail_mode). That split made it very hard to determine how the respective values were actually produced and consumed, especially in the presence of--pass=checkon the command-line, or when building auxiliary crates.This PR replaces the separate fields and enums for pass-mode and fail-mode with a single
PassFailModeenum and a singlepass_fail_modefield.With this new representation, it should hopefully be easier to understand and modify the pass/fail-mode logic.
In order to focus on the main migration, I have mostly refrained from subsequent cleanups.
r? jieyouxu