forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 347
[Cherry-pick][stable/20240723] Add --update-tests to llvm-lit #11400
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
Open
hnrklssn
wants to merge
10
commits into
swiftlang:stable/20240723
Choose a base branch
from
hnrklssn:cherry-pick-update-tests-stable
base: stable/20240723
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[Cherry-pick][stable/20240723] Add --update-tests to llvm-lit #11400
hnrklssn
wants to merge
10
commits into
swiftlang:stable/20240723
from
hnrklssn:cherry-pick-update-tests-stable
Conversation
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
This reverts commit llvm@e495231 to reland the --update-tests feature, originally landed in llvm#108425. (cherry picked from commit e1ff432)
The early exit we relied on to only invoke test updaters for failing tests requires that there was no output to stdout or stderr, and that timeouts weren't enabled. When these conditions weren't fulfilled, test updaters would be invoked even on passing or XFAILed tests. (cherry picked from commit 58996c0)
…vm#154147) This adds an updater to lit's --update-tests flag with support for `diff`. If a RUN line containing the `diff` command fails, this function will use heuristics to try to deduce which file is the "reference" file, and copy the contents of the other file to the reference. If it cannot deduce which file is the reference file, it does nothing. The heuristics are currently: - does one of the files end in .expected while the other does not? Then the .expected file is the reference. - does one of the file paths contain the substring ".tmp" while the other does not? Then the file not containing ".tmp" is the reference. This matches cases where one file path is constructed using the `%t` substitution. (cherry picked from commit 6c3f18e)
Previously this test case would `touch %S/empty.txt` to create and empty file. The test case then copies contents to that file, so if run a second time the `touch` command would not create an empty file. `llvm/utils/lit/tests/diff-test-update.py` also no longer matches against file paths other than the final bit of the file name. This prevents test failures on Windows due to different path separators. (cherry picked from commit 82ef4ee)
llvm#155354) Should fix Windows build bot failures such as https://lab.llvm.org/buildbot/#/builders/46/builds/22281. The test (and the followup fix in llvm#155303) did not properly account for Windows style path separators. (cherry picked from commit 7d35e29)
(cherry picked from commit 9eb17cc)
) Previously we compared paths by string manipulation, however Windows paths can use both '\' and '/' as path separators, which made this fragile. This uses the pathlib.Path.samefile API instead. (cherry picked from commit b018151)
(cherry picked from commit 1b05212)
…ndings. (llvm#158297) Should fix bot: https://lab.llvm.org/buildbot/#/builders/46/builds/23206 (cherry picked from commit b0cb4e1)
@swift-ci please test |
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.
This cherry-picks a series of commits implementing the --update-tests feature in llvm-lit. It makes it a lot more convenient to fix certain types of test cases when they fail, and I plan to make extensive use of those types of test cases in Swift.