Age | Commit message (Collapse) | Author | Files | Lines |
|
In `llvm-cov show`, this option rounds counters (line, branch) to
`[1,0]` at rendering. This will be useful when the number of counts
doesn't interest but **Covered/uncoverd** does.
|
|
NFC except for calculating `Total`. I've replaced
`(uint64_t)+(uint64_t)` with `(double)+(double)`.
This is still inexact with large numbers `(1LL << 53)` but will be expected to prevent possible overflow.
|
|
|
|
Identified with readability-redundant-control-flow.
|
|
Currently both True/False counts were folded. It lost the information,
"It is True or False before folding." It prevented recalling branch
counts in merging template instantiations.
In `llvm-cov`, a folded branch is shown as:
- `[True: n, Folded]`
- `[Folded, False n]`
In the case If `n` is zero, a branch is reported as "uncovered". This is
distinguished from "folded" branch. When folded branches are merged,
`Folded` may be dissolved.
In the coverage map, either `Counter` is `Zero`. Currently both were
`Zero`.
Since "partial fold" has been introduced, either case in `switch` is
omitted as `Folded`.
Each `case:` in `switch` is reported as `[True: n, Folded]`, since
`False` count doesn't show meaningful value.
When `switch` doesn't have `default:`, `switch (Cond)` is reported as
`[Folded, False: n]`, since `True` count was just the sum of `case`(s).
`switch` with `default` can be considered as "the statement that doesn't
have any `False`(s)".
|
|
(#95662)
I replaced "jump to first uncovered line" with UI buttons and keyboard
shortcut to jump between uncovered parts of code: lines (key L), branchs
(key B), regions (key R).
User can also jump in reverse direction with shift+key.
|
|
Personally I use
[cargo-llvm-cov](https://github.com/taiki-e/cargo-llvm-cov) which
creates helpful HTML coverage reports, but they don't support a dynamic
dark themes.
I updated the styling to support both dark and bright color themes based
on the browser preference. The bright theme should look similar to the
current theme.
I also improved some color contrasts (Firefox accessibility tool
reported them) and ensured that line-number links keep their
text-decoration.
Things that both have `.tooltip` and `.red` look kinda odd as the
coloring is now based on tinting with transparency. Given that the
tooltip should always show 0 in such cases (otherwise it wouldn't be
red) the tooltip could be removed there on the HTML generation, but that
seemed out of scope for my style only change.
|
|
output (#80952)
1. add the missing condition for MC/DC in hasSubViews()
2. add style for selected line
3. remove name="Ln" attribute in the link within MC/DC views
4. remove color for \n
|
|
differenly (gray instead red) and make the table a bit nicer (#75780)
|
|
Coverage (2/3)"
Part 2 of 3. This includes the Visualization and Evaluation components.
Differential Revision: https://reviews.llvm.org/D138847
|
|
This patch renames {starts,ends}with to {starts,ends}_with for
consistency with std::{string,string_view}::{starts,ends}_with in
C++20. Since there are only a handful of occurrences, this patch
skips the deprecation phase and simply renames them.
|
|
Coverage (2/3)"
This reverts commit 618a22144db5e45da8c95dc22064103e1b5e5b71.
Buildbots failing on windows and one other issue.
|
|
(2/3)
Part 2 of 3. This includes the Visualization and Evaluation components.
Differential Revision: https://reviews.llvm.org/D138847
|
|
This is a GSoC 2023 project ([discourse link](https://discourse.llvm.org/t/coverage-support-a-hierarchical-directory-structure-in-generated-coverage-html-reports/68239)).
llvm-cov currently generates a single top-level index HTML file, which causes rendering scalability issues in large projects. This patch adds support for hierarchical directory structure into the HTML reports to solve scalability issues by introducing the following changes:
- Added a new command line option `--show-directory-coverage` for `llvm-cov show`. It works both for `--format=html` and `--format=text`.
- Two new classes: `CoveragePrinterHTMLDirectory` and `CoveragePrinterTextDirectory` was added to support the new option.
- A tool class `DirectoryCoverageReport` was added to support the two classes above.
- Updated the document.
- Added a new regression test for `--show-directory-coverage`.
Reviewed By: phosek, gulfem
Differential Revision: https://reviews.llvm.org/D151283
|
|
Reviewed By: alanphipps
Differential Revision: https://reviews.llvm.org/D157608
|
|
These source files no longer use Optional<T>, so they do not need to
include Optional.h.
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
|
|
This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
|
|
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
|
|
This patch replaces Optional::hasValue with the implicit cast to bool
in conditionals only.
|
|
This reverts commit aa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d.
|
|
|
|
|
|
Add a pairs of parameters to set coverage watermark for llvm-cov, and
user can change the percentage thresholds marked with different colors
in the report.
Patch By: tanjinhua
Differential Revision: https://reviews.llvm.org/D116876
|
|
Identified with bugprone-argument-comment.
|
|
Identified with readability-redundant-string-init.
|
|
This is an enhancement to LLVM Source-Based Code Coverage in clang to track how
many times individual branch-generating conditions are taken (evaluate to TRUE)
and not taken (evaluate to FALSE). Individual conditions may comprise larger
boolean expressions using boolean logical operators. This functionality is
very similar to what is supported by GCOV except that it is very closely
anchored to the ASTs.
Differential Revision: https://reviews.llvm.org/D84467
|
|
|
|
The build failed with
error: call to deleted constructor of 'llvm::Error'
errors.
This reverts commit 1c2241a7936bf85aa68aef94bd40c3ba77d8ddf2.
|
|
|
|
This is how it should've been and brings it more in line with
std::string_view. There should be no functional change here.
This is mostly mechanical from a custom clang-tidy check, with a lot of
manual fixups. It uncovers a lot of minor inefficiencies.
This doesn't actually modify StringRef yet, I'll do that in a follow-up.
|
|
to reflect the new license.
We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.
Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.
llvm-svn: 351636
|
|
llvm-svn: 349710
|
|
As noted by Adrian on llvm-commits, PrintHTMLEscaped and PrintEscaped in
StringExtras did not conform to the LLVM coding guidelines. This commit
rectifies that.
llvm-svn: 333669
|
|
This removes some duplicate logic to escape characters in HTML output.
llvm-svn: 333608
|
|
Summary:
This minor change allows to copy snippets from HTML reports so they
will be pasted in the following format:
%LineNumber%\t%HitCount%\t%CodeLine%
rather then being split onto multiple lines. To see this in action, try copy
pasting from https://chromium-coverage.appspot.com/reports/560344/linux/chromium/src/third_party/zlib/compress.c.html
Requested in https://bugs.chromium.org/p/chromium/issues/detail?id=845571
Reviewers: vsk
Reviewed By: vsk
Subscribers: llvm-commits, morehouse, kcc
Differential Revision: https://reviews.llvm.org/D47231
llvm-svn: 333034
|
|
Summary: Existing version doesn't work on Windows as it always prints 0.00.
Reviewers: Dor1s
Reviewed By: Dor1s
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D42767
llvm-svn: 323923
|
|
Summary:
This commit adds the following changes:
1) coverage numbers are aligned to the left and padded with spaces in order to
provide better readability for percentage values, e.g.:
```
file1 | 89.13% (123 / 2323) | 100.00% (55 / 55) | 9.33% (14545 / 234234)
file_asda | 1.78% ( 23 / 4323) | 32.31% (555 / 6555) | 67.89% (1545 / 2234)
fileXXX | 100.00% (12323 / 12323) | 100.00% (555 / 555) | 100.00% (12345 / 12345)
```
2) added "hover" attribute to CSS for highlighting table row under mouse cursor
see screenshot attached to the phabricator review page
{F5764813}
3) table title row and "totals" row now use bold text
Reviewers: vsk, morehouse
Reviewed By: vsk
Subscribers: kcc, llvm-commits
Differential Revision: https://reviews.llvm.org/D42093
llvm-svn: 323892
|
|
llvm-svn: 320631
|
|
This fixes an issue where llvm-cov prints an empty line, thinking it
needs to display region markers, when it actually doesn't.
llvm-svn: 317762
|
|
We've worked around bugs in the frontend by ignoring the count from
wrapped segments when a line has at least one region entry segment.
Those frontend bugs are now fixed, so it's time to regenerate the
checked-in covmapping files and remove the workaround.
llvm-svn: 317761
|
|
This is a simple code cleanup. It will facilitate moving
LineCoverageIterator to libCoverage.
llvm-svn: 316140
|
|
llvm-cov tends to highlight too many regions because its policy is to
highlight all region entry segments. This can look confusing to users:
not all region entry segments are interesting and deserve highlighting.
Emitting these highlights only when the region count differs from the
line count is a more user-friendly policy.
llvm-svn: 316109
|
|
Instead of copying around the wrapped segment and the list of line
segments, just pass a reference to a LineCoverageStats object. This
simplifies the interface. It also makes an upcoming change to suppress
distracting highlights possible.
llvm-svn: 316108
|
|
llvm-cov typically doesn't highlight gap segments, but it should if the
gap occurs after an uncovered region in order to preserve continuity.
llvm-svn: 316107
|
|
There were two copies of the logic needed to construct a line stats
object for each line in a range: this patch brings it down to one. In
the future, this will make it easier for IDE clients to display coverage
in-line in source editors. To do that, we just need to move the new
LineCoverageIterator class to libCoverage.
llvm-svn: 315789
|
|
Differential Revision: https://reviews.llvm.org/D38457
llvm-svn: 314782
|
|
Before this change using any of the -name*= command line options with an output
directory would result in a single file (functions.txt/functions.html)
containing the coverage for those specific functions. Now you get the same
directory structure as when not using any -name*= options.
Differential Revision: https://reviews.llvm.org/D38280
llvm-svn: 314396
|
|
options"
Test failures.
llvm-svn: 314314
|
|
Before this change using any of the -name*= command line options with an output
directory would result in a single file (functions.txt/functions.html)
containing the coverage for those specific functions. Now you get the same
directory structure as when not using any -name*= options.
Differential Revision: https://reviews.llvm.org/D38280
llvm-svn: 314310
|
|
After clang started emitting deferred regions (r312818), llvm-cov has
had a hard time picking reasonable line execuction counts. There have
been one or two generic improvements in this area (e.g r310012), but
line counts can still report coverage for whitespace instead of code
(llvm.org/PR34612).
To fix the problem:
* Introduce a new region kind so that frontends can explicitly label
gap areas.
This is done by changing the encoding of the columnEnd field of
MappingRegion. This doesn't substantially increase binary size, and
makes it easy to maintain backwards-compatibility.
* Don't set the line count to a count from a gap area, unless the count
comes from a wrapped segment.
* Don't highlight gap areas as uncovered.
Fixes llvm.org/PR34612.
llvm-svn: 313597
|