Skip to content
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

Branch coverage #8

Open
taiki-e opened this issue Jun 4, 2021 · 9 comments
Open

Branch coverage #8

taiki-e opened this issue Jun 4, 2021 · 9 comments
Labels
C-enhancement Category: A new feature or an improvement for an existing one C-upstream-bug Category: This is a bug of compiler or dependencies (the fix may require action in the upstream)

Comments

@taiki-e
Copy link
Owner

taiki-e commented Jun 4, 2021

UPDATE: 0.6.8 (#356) added unstable --branch flag to enable branch coverage. (requires nightly-2024-03-16+.)

LLVM supports branch coverage (https://reviews.llvm.org/D84467), -Zinstrument-coverage does not support it yet.

See rust-lang/rust#79649 for more.

@taiki-e taiki-e added C-enhancement Category: A new feature or an improvement for an existing one S-blocked Status: Blocked on something else labels Jun 4, 2021
@taiki-e
Copy link
Owner Author

taiki-e commented Jun 5, 2021

I believe this is why we see - (0/0) in html report.

5

(- (0/0) does not look good and confusing, so I need to find a way to get rid of that display somehow.)

@taiki-e taiki-e mentioned this issue Jun 5, 2021
bors bot added a commit that referenced this issue May 30, 2022
173: Add --fail-uncovered-{lines,regions,functions} options r=taiki-e a=taiki-e

```
        --fail-uncovered-lines <MAX>
            Exit with a status of 1 if the uncovered lines are greater than MAX

        --fail-uncovered-regions <MAX>
            Exit with a status of 1 if the uncovered regions are greater than MAX

        --fail-uncovered-functions <MAX>
            Exit with a status of 1 if the uncovered functions are greater than MAX
```

There is no `--fail-uncovered-branches` option because branch coverage is not supported yet by rustc (#8).

Closes #170 

174: Add --ignore-run-fail option r=taiki-e a=taiki-e

```
        --ignore-run-fail
            Run all tests regardless of failure and generate report

            If tests failed but report generation succeeded, exit with a status of 0.
```

Closes #169 

Co-authored-by: Taiki Endo <te316e89@gmail.com>
@taiki-e taiki-e added the C-upstream-bug Category: This is a bug of compiler or dependencies (the fix may require action in the upstream) label Sep 3, 2022
@TomFryersMidsummer
Copy link

The output can be made nicer with the following workaround.

cargo llvm-cov --html && sed -i "s_<td[^>]*>[^t]*</td></tr>_</tr>_g" target/llvm-cov/html/index.html

@Zalathar
Copy link

Branch coverage support has landed in nightly: rust-lang/rust#79649 (comment).

@taiki-e taiki-e removed the S-blocked Status: Blocked on something else label Mar 16, 2024
@taiki-e
Copy link
Owner Author

taiki-e commented Mar 16, 2024

0.6.8 (#356) added unstable --branch flag to enable branch coverage. (requires nightly-2024-03-16+.)

@CobaltCause
Copy link
Contributor

Seems to also work on rustc 1.78.0-nightly (c67326b06 2024-03-15)?

@taiki-e
Copy link
Owner Author

taiki-e commented Mar 17, 2024

Seems to also work on rustc 1.78.0-nightly (c67326b06 2024-03-15)?

It is nightly-2024-03-16. (The commit date ("c67326b06 2024-03-15" in this case) is one day before the rustup toolchain version: rust-lang/rust#51533)

@jayvdb

This comment was marked as off-topic.

@taiki-e

This comment was marked as off-topic.

@jayvdb

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: A new feature or an improvement for an existing one C-upstream-bug Category: This is a bug of compiler or dependencies (the fix may require action in the upstream)
Projects
None yet
Development

No branches or pull requests

5 participants