summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-cov] Avoid 0% when reporting something that's 0/0Alex Lorenz2016-11-211-4/+8
| | | | | | | | | | | | | This commit makes llvm-cov avoid showing 0% (0/0) coverage for things like file function coverage, etc. in reports and HTML output. This can happen for files like headers that have macros but no functions. This commit makes llvm-cov report - (0/0) instead. rdar://29246480 Differential Revision: https://reviews.llvm.org/D26615 llvm-svn: 287539
* [llvm-cov] Turn line numbers in html reports into clickable linksVedant Kumar2016-11-021-3/+5
| | | | llvm-svn: 285853
* [llvm-cov] Do not print out the filename of the object fileVedant Kumar2016-10-251-5/+2
| | | | | | | | | When we load coverage data from multiple objects, we don't have a way to attribute a source object to a function record. Printing out the object filename next to the source filename is already not very useful: soon, it'll actually become misleading. Stop printing out the filename now. llvm-svn: 285043
* [llvm-cov] Get rid of all invalid filename referencesVedant Kumar2016-09-231-1/+1
| | | | | | | | | | | | | | We used to append filenames into a vector of std::string, and then append a reference to each string into a separate vector. This made it easier to work with the getUniqueSourceFiles API. But it's buggy. std::string has a small-string optimization, so you can't expect to capture a reference to one if you're copying it into a growing vector. Add a test that triggers this invalid reference to std::string scenario, and kill the issue with fire by just using ArrayRef<std::string> everywhere. llvm-svn: 282281
* [llvm-cov] Minor cleanup. NFC.Vedant Kumar2016-09-231-6/+6
| | | | llvm-svn: 282280
* [llvm-cov] Emit a link to some documentationVedant Kumar2016-09-191-0/+7
| | | | llvm-svn: 281883
* [llvm-cov] Make a helper method static for re-use (NFC)Vedant Kumar2016-09-191-2/+2
| | | | llvm-svn: 281876
* [llvm-cov] Track function and instantiation coverage separatelyVedant Kumar2016-09-191-2/+5
| | | | | | | | | | | | | | | | | | | | These are distinct statistics which are useful to look at separately. Example: say you have a template function "foo" with 5 instantiations and only 3 of them are covered. Then this contributes (1/1) to the total function coverage and (3/5) to the total instantiation coverage. I.e, the old "Function Coverage" column has been renamed to "Instantiation Coverage", and the new "Function Coverage" aggregates information from the various instantiations of a function. One benefit of making this switch is that the Line and Region coverage columns will start making sense. Let's continue the example and assume that the 5 instantiations of "foo" cover {2, 4, 6, 8, 10} out of 10 lines respectively. The new line coverage for "foo" is (10/10), not (30/50). The old scenario got confusing because we'd report that there were more lines in a file than what was actually possible. llvm-svn: 281875
* [llvm-cov] Don't recompute the 'Covered' field from *CoverageInfo (NFC)Vedant Kumar2016-09-191-6/+5
| | | | llvm-svn: 281874
* [llvm-cov] Drop another redundant 'No.' suffixVedant Kumar2016-09-191-1/+1
| | | | llvm-svn: 281872
* [llvm-cov] Move some layout logic to the right spot (NFC)Vedant Kumar2016-09-151-1/+1
| | | | llvm-svn: 281590
* [llvm-cov] Hide instantiation views for unexecuted functionsVedant Kumar2016-09-151-1/+9
| | | | | | | | Copying in the full text of the function doesn't help at all when we already know that it's never executed. Just say that it's unexecuted -- the relevant source text has already been printed. llvm-svn: 281589
* [llvm-cov] Don't create 'jump to ...' links in nested viewsVedant Kumar2016-09-151-1/+1
| | | | | | | Doing so is pointless, since the whole view is usually visible in a small amount of space. llvm-svn: 281588
* [llvm-cov] Make a method name more accurate (NFC)Vedant Kumar2016-09-151-3/+2
| | | | llvm-svn: 281581
* [llvm-cov] Just emit the version number in the index fileVedant Kumar2016-09-131-2/+1
| | | | | | | Having the version information in every view is distracting, especially if there are several sub-views. llvm-svn: 281414
* [llvm-cov] - Included footer "Generated by llvm-cov -- llvm version <version ↵Ying Yi2016-09-131-2/+4
| | | | | | | | | | number>" in the coverage report. The llvm-cov version information will be useful to the user when comparing the code coverage across different versions of llvm-cov. This patch provides the llvm-cov version information in the generated coverage report. Differential Revision: https://reviews.llvm.org/D24457 llvm-svn: 281321
* [llvm-cov] Move the 'jump to first unexecuted line' linkVedant Kumar2016-09-101-14/+15
| | | | | | | Having it in the same row as the source name is jarring. Move it next to the "Source" column label. llvm-svn: 281146
* [llvm-cov] Minor visual tweaks for html reportsVedant Kumar2016-09-101-54/+21
| | | | | | | - Change the location of the 'Region Coverage' column. - Use less css and text for some labels. llvm-svn: 281145
* [llvm-cov] Remove some asserts in the html renderer (NFC)Vedant Kumar2016-09-091-5/+1
| | | | | | | | | | | These asserts are making tests fragile. The renderer does not enter an invalid state when they fail, however, it may spit out a garbled coverage report because the source text no longer matches the provided coverage mapping. Another follow-up to r281072. llvm-svn: 281076
* [llvm-cov] Emit a summary in the report directory's indexVedant Kumar2016-09-091-21/+105
| | | | | | | | llvm-cov writes out an index file in '-output-dir' mode, albeit not a very informative one. Try to fix that by using the CoverageReport API to include some basic summary information in the index file. llvm-svn: 281011
* [llvm-cov] Fix issues with segment highlighting in the html viewVedant Kumar2016-09-081-16/+10
| | | | | | | | | | | | | The text and html coverage views take different approaches to emitting highlighted regions. That's because this problem is easier in the text view: there's no need to worry about escaping text or adding tooltip content to a highlighted snippet. Unfortunately, the html view didn't get region highlighting quite right. This patch fixes the situation, bringing parity between the two views. llvm-svn: 280981
* [llvm-cov] Use less space to describe source namesVedant Kumar2016-09-081-5/+3
| | | | | | | | In r279628, we made SourceCoverageView list the binary associated with a view and started adding labels (e.g "Source: foo" or "Function: bar") to everything. Condense this information a bit to unclutter reports. llvm-svn: 280896
* [llvm-cov] Add the project summary to the text coverage report for each ↵Ying Yi2016-09-061-6/+1
| | | | | | | | | | source file. This patch is a spin-off from https://reviews.llvm.org/D23922. It extends the text view to preserve the same feature as the html view. Differential Revision: https://reviews.llvm.org/D24241 llvm-svn: 280756
* [llvm-cov] Add the "Go to first unexecuted line" feature.Ying Yi2016-09-061-3/+12
| | | | | | | | This patch provides easy navigation to find the zero count lines, especially useful when the source file is very large. Differential Revision: https://reviews.llvm.org/D23277 llvm-svn: 280739
* [llvm-cov] Drop redundant "No." suffix in a column titleVedant Kumar2016-08-311-1/+1
| | | | llvm-svn: 280181
* [llvm-cov] Use the native path in the coverage report.Ying Yi2016-08-301-2/+8
| | | | | | | | | | | The coverage reports contain the source or binary file paths. On Windows, the file path might contain the seperators of both '/' and '\'. This patch uses the native path in the coverage reports. For example, on Windows, all '/' are converted to '\'. Differential Revision: https://reviews.llvm.org/D23922 llvm-svn: 280061
* [llvm-cov] Add the project summary to each source file coverage report.Ying Yi2016-08-241-11/+88
| | | | | | | | | | | | This patch includes the following changes: - Included header "Code coverage report" and include the date that the report was created. - Included title (as specified in a command line option, (i.e llvm-cov -project-title="Simple Test") - In the summary, list the elf files that the source code file has contributed to. - Used column heading for "Line No.", "Count No.", Source". Differential Revision: https://reviews.llvm.org/D23345 llvm-svn: 279628
* [LLVM-COV]Replace tabs to the space indentations in the HTML coverage report.Ying Yi2016-08-041-12/+24
| | | | | | | | | | | When using orbis-llvm-cov.exe to generate the HTML report, the HTML report can look quite different to the source file if it includes tabs.The default tab size is 2 spaces instead of 8 spaces. A command line switch is be added to set the tab size. Differential Revision: https://reviews.llvm.org/D23087 llvm-svn: 277715
* [llvm-cov] Add a debug mode for source range highlighting (in html)Vedant Kumar2016-07-271-10/+34
| | | | | | | llvm-cov's `-dump' option now emits information which helps debug source range highlighting in html mode. llvm-svn: 276924
* Revert "[llvm-cov] Minor aesthetic improvements for html reports"Vedant Kumar2016-07-271-9/+7
| | | | | | This reverts commit r276906. It breaks tests. llvm-svn: 276908
* [llvm-cov] Minor aesthetic improvements for html reportsVedant Kumar2016-07-271-7/+9
| | | | | | | This fixes the highlighting for lines without any coverage segments. I don't have a neat way of testing this yet, but am working on it. llvm-svn: 276906
* [llvm-cov] Don't copy stylesheets into index filesVedant Kumar2016-07-221-1/+2
| | | | | | Just link in the stylesheet from the toplevel dir of the report. llvm-svn: 276468
* [llvm-cov] Use relative paths to the stylesheet (for html reports)Vedant Kumar2016-07-211-56/+71
| | | | | | | | | | This makes it easy to swap out the default stylesheet for a custom one. It also shaves ~6.62 MB out of the report directory for a full coverage build of llvm+clang. While we're at it, prune the CSS and add tests for it. llvm-svn: 276359
* [llvm-cov] Place anchors around line numbers in html reportsVedant Kumar2016-07-181-3/+6
| | | | | | Based on a suggestion by Harlan Haskins! llvm-svn: 275840
* [llvm-cov] Add support for creating html reportsVedant Kumar2016-07-061-0/+436
Based on a patch by Harlan Haskins! Differential Revision: http://reviews.llvm.org/D18278 llvm-svn: 274688
OpenPOWER on IntegriCloud