MCDC Coverage: instrument last boolean RHS operands from condition coverage by RenjiSann · Pull Request #125766 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation25 Commits3 Checks6 Files changed
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
[ Show hidden characters]({{ revealButtonHref }})
Fresh PR from #124652
--
This PR ensures that the top-level boolean expressions that are not part of the control flow are correctly instrumented thanks to condition coverage.
See discussion on #124120.
Depends on @Zalathar 's condition coverage implementation #125756.
r? @fee1-dead
rustbot has assigned @fee1-dead.
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 added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Some changes occurred in coverage tests.
cc @Zalathar
Some changes occurred in coverage instrumentation.
cc @Zalathar
I only looked at the last three commit, because the first three are from #125756.
This seems ok to me but I know very little about the coverage code. @Zalathar, could you also review, and if you are happy then I will give r+. Thanks!
Other than some tiny nitpicks, the main changes seem reasonable.
When the nits are addressed (fixed or justified), this should be good to go.
All nitpicks are addressed. This is good to go :)
ZhuUx mentioned this pull request
4 tasks
Hi, @Zalathar
Can you merge this, if it's OK for you ?
I'm happy with this, with or without addressing my tiny nitpick.
r+ from me, but I don't actually have permissions to add this to the queue on my own.
r=me once the expr_span
nit has been addressed.
@bors delegate=RenjiSann
✌️ @RenjiSann, you can now approve this pull request!
If @nnethercote told you to "r=me
" after making some further change, please make that change, then do @bors r=@nnethercote
Condition coverage extends branch coverage to treat the specific case of last operands of boolean decisions not involved in control flow. This is ultimately made for MCDC to be exhaustive on all boolean expressions.
This patch adds a call to visit_branch_coverage_operation
to track the
top-level operand of the said decisions, and changes
visit_coverage_standalone_condition
so MCDC branch registration is called
when enabled on these last RHS cases.
📌 Commit e15adef has been approved by nnethercote
It is now in the queue for this repository.
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
bors added a commit to rust-lang-ci/rust that referenced this pull request
Rollup of 6 pull requests
Successful merges:
- rust-lang#125447 (Allow constraining opaque types during subtyping in the trait system)
- rust-lang#125766 (MCDC Coverage: instrument last boolean RHS operands from condition coverage)
- rust-lang#125880 (Remove
src/tools/rust-demangler
) - rust-lang#126154 (StorageLive: refresh storage (instead of UB) when local is already live)
- rust-lang#126572 (override user defined channel when using precompiled rustc)
- rust-lang#126662 (Unconditionally warn on usage of
wasm32-wasi
)
r? @ghost
@rustbot
modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#125766 - RenjiSann:fresh-mcdc-branch-on-bool, r=nnethercote
MCDC Coverage: instrument last boolean RHS operands from condition coverage
Fresh PR from rust-lang#124652
--
This PR ensures that the top-level boolean expressions that are not part of the control flow are correctly instrumented thanks to condition coverage.
See discussion on rust-lang#124120.
Depends on @Zalathar
's condition coverage implementation rust-lang#125756.
bors added S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
labels
This was referenced
Jul 2, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request
…thar
[Coverage][MCDC] Group mcdc tests and fix panic when generating mcdc code for inlined expressions.
Changes
- Group all mcdc tests to one directory.
- Since mcdc instruments different mappings for boolean expressions with normal branch coverage as rust-lang#125766 introduces, it would be better also trace branch coverage results in mcdc tests.
- So far rustc does not call
CoverageInfoBuilderMethods::init_coverage
for inlined functions. As a result, it could panic if it tries to instrument mcdc statements for inlined functions due to uninitialized cond bitmaps. We can reproduce this issue by current nightly rustc and the test with flag--release
. This patch fixes it.
Labels
Area: Source-based code coverage (-Cinstrument-coverage)
Status: This is awaiting some action (such as code changes or more information) from the author.
Relevant to the compiler team, which will review and decide on the PR/issue.