-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
[lit] Fix some issues from --per-test-coverage #65242
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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 file contains 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 file contains 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 file contains 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 file contains 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 file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,24 @@ | ||
# Test if lit_config.per_test_coverage in lit.cfg sets individual test case coverage. | ||
|
||
# RUN: %{lit} -a -v %{inputs}/per-test-coverage-by-lit-cfg/per-test-coverage-by-lit-cfg.py \ | ||
# RUN: | FileCheck -match-full-lines %s | ||
# | ||
# CHECK: PASS: per-test-coverage-by-lit-cfg :: per-test-coverage-by-lit-cfg.py ({{[^)]*}}) | ||
# RUN: %{lit} -a -vv -Dexecute_external=False \ | ||
# RUN: %{inputs}/per-test-coverage-by-lit-cfg/per-test-coverage-by-lit-cfg.py | \ | ||
# RUN: FileCheck -DOUT=stdout %s | ||
|
||
# RUN: %{lit} -a -vv -Dexecute_external=True \ | ||
# RUN: %{inputs}/per-test-coverage-by-lit-cfg/per-test-coverage-by-lit-cfg.py | \ | ||
# RUN: FileCheck -DOUT=stderr %s | ||
|
||
# CHECK: {{^}}PASS: per-test-coverage-by-lit-cfg :: per-test-coverage-by-lit-cfg.py ({{[^)]*}}) | ||
# CHECK: Command Output ([[OUT]]): | ||
# CHECK-NEXT: -- | ||
# CHECK: export | ||
# CHECK: LLVM_PROFILE_FILE=per-test-coverage-by-lit-cfg0.profraw | ||
# CHECK: per-test-coverage-by-lit-cfg.py | ||
# CHECK: {{RUN}}: at line 2 | ||
# CHECK: export | ||
# CHECK: LLVM_PROFILE_FILE=per-test-coverage-by-lit-cfg1.profraw | ||
# CHECK: per-test-coverage-by-lit-cfg.py | ||
# CHECK: {{RUN}}: at line 3 | ||
# CHECK: export | ||
# CHECK: LLVM_PROFILE_FILE=per-test-coverage-by-lit-cfg2.profraw | ||
# CHECK: per-test-coverage-by-lit-cfg.py |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,24 @@ | ||
# Test LLVM_PROFILE_FILE is set when --per-test-coverage is passed to command line. | ||
|
||
# RUN: %{lit} -a -v --per-test-coverage %{inputs}/per-test-coverage/per-test-coverage.py \ | ||
# RUN: | FileCheck -match-full-lines %s | ||
# | ||
# CHECK: PASS: per-test-coverage :: per-test-coverage.py ({{[^)]*}}) | ||
# RUN: %{lit} -a -vv --per-test-coverage -Dexecute_external=False \ | ||
# RUN: %{inputs}/per-test-coverage/per-test-coverage.py | \ | ||
# RUN: FileCheck -DOUT=stdout %s | ||
|
||
# RUN: %{lit} -a -vv --per-test-coverage -Dexecute_external=True \ | ||
# RUN: %{inputs}/per-test-coverage/per-test-coverage.py | \ | ||
# RUN: FileCheck -DOUT=stderr %s | ||
|
||
# CHECK: {{^}}PASS: per-test-coverage :: per-test-coverage.py ({{[^)]*}}) | ||
# CHECK: Command Output ([[OUT]]): | ||
# CHECK-NEXT: -- | ||
# CHECK: export | ||
# CHECK: LLVM_PROFILE_FILE=per-test-coverage0.profraw | ||
# CHECK: per-test-coverage.py | ||
# CHECK: {{RUN}}: at line 2 | ||
# CHECK: export | ||
# CHECK: LLVM_PROFILE_FILE=per-test-coverage1.profraw | ||
# CHECK: per-test-coverage.py | ||
# CHECK: {{RUN}}: at line 3 | ||
# CHECK: export | ||
# CHECK: LLVM_PROFILE_FILE=per-test-coverage2.profraw | ||
# CHECK: per-test-coverage.py |
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.
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.
Why is the $ dropped in the buildPdbgCommand?
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.
Good question.
Originally, my goal was for the assert to mimic how kPdbgRegex will actually be used later when expanding
%dbg
substitutions. That's the usage that the assert is trying to verify will work correctly. Thus, this patch changes the assert in two ways: the searched string contains all of%dbg(...) cmd-line
instead of just%dbg(...)
, and it does not use$
.However, now that you ask, I think the assert should be stricter. For example, D154987 proposes to extend kPdbgRegex to permit newlines, which might appear in
lit.run(cmd)
in PYTHON directives, as in the example in that review's summary. Using$
in the assert here would have caught that existing deficiency of kPdbgRegex: its.*
doesn't match beyond the first newline.Instead of
$
, what do you think of usingre.fullmatch
in the assert? That is, buildPdbgCommand expects kPdbgRegex to match the entire string it's building.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.
I went ahead and applied that change and wrote a commit log to explain it.
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.
LGTM but does it mean you'll just rebase and push to the repo using pure git? If using the github tool AFAIK you can only merge and squash on the LLVM project so the commit message won't show up unless you modify the PR message. I might be wrong though, I haven't interacted much with github.
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.
At least from the web UI you have the chance to edit the final commit message. So you can combine them there if you're ok with it all being one commit.
(otherwise yes manually push some of it)
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.
Thanks for the review!
Yes, I performed most steps from the git command line: squash commits and commit logs together, rebase onto the latest main, and force push to the PR. I then clicked "Squash and merge" and copied and pasted my new commit log there. The commit log it initially offered was the original comment I posted for this PR, but the focus of the PR has shifted since then. It would be nicer if it offered the current commit logs, squashed in the same way a
git merge --squash
would squash them.I don't know how to accomplish the rebase onto main via the github web UI... even though it seems like that's almost always going to be required given how frequently new commits show up on main. That means I needed to work from the command line anyway, so it seemed more practical to handle squashing there too.
Please let me know if I've overlooked best practices for using the github web UI.
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.
From https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/about-merge-methods-on-github#squashing-your-merge-commits it seems squash and merge is actually a squash and rebase (it makes it clear it's a fast forward).
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.
The web UI squash-and-merge will automatically rebase to current HEAD.
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.
Thanks for the clarifications. For some reason, I thought it previously rejected one when I wasn't caught up to main, but perhaps I had conflicts then. I'll try again next time.
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.
Yep, it worked fine in another PR that had no conflicts.