summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-cov
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-cov] Warn if -show-functions is used without query filesVedant Kumar2017-09-251-0/+3
| | | | | | | | | | llvm-cov's report mode does not print any output when -show-functions is specified and no source files are specified. This can be surprising, so the tool should at least print out an error message when this happens. rdar://problem/34636859 llvm-svn: 314175
* [llvm-cov] Improve error messaging for function mismatchesVedant Kumar2017-09-211-1/+4
| | | | | | | | | Passing "-dump" to llvm-cov will now print more detailed information about function hash and counter mismatches. This should make it easier to debug *.profdata files which contain incorrect records, and to debug other scenarios where coverage goes missing due to mismatch issues. llvm-svn: 313853
* [llvm-cov] Make report metrics agree with line exec counts, fixes PR34615Vedant Kumar2017-09-195-9/+9
| | | | | | | | | Use the same logic as the line-oriented coverage view to determine the number of covered lines in a function. Fixes llvm.org/PR34615. llvm-svn: 313604
* [Coverage] Use gap regions to select better line exec countsVedant Kumar2017-09-182-21/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [llvm-cov] Repair a test. NFC.Vedant Kumar2017-09-181-1/+1
| | | | | | | The checks with the MARKER prefix were not being run over the right input, because stderr was not redirected properly. llvm-svn: 313596
* [llvm-cov] Avoid over-counting covered lines and regionsVedant Kumar2017-09-157-0/+80
| | | | | | | | | | | | | | | | * Fix an unsigned integer overflow in the logic that computes the number of uncovered lines in a function. * When aggregating region and line coverage summaries, take into account that different instantiations may have a different number of regions. The new test case provides test coverage for both bugs. I also verified this change by preparing a coverage report for a stage2 build of llc -- the new assertions should detect any outstanding over-counting bugs. Fixes PR34613. llvm-svn: 313417
* [llvm-cov] Try to fix a test on WindowsVedant Kumar2017-09-111-2/+2
| | | | | | | | | Failing bot: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/4791 This looks like another stderr redirection issue. llvm-svn: 312975
* [llvm-cov] Allow hiding instantiation/region coverage from summary tablesEli Friedman2017-09-113-6/+3
| | | | | | | | | | | | | Region coverage is difficult to explain without going deep into how coverage is implemented. Instantiation coverage is easier to explain, but probably not useful in most cases (templates don't exist in C, and most C++ code contains relatively few templates). This patch adds the options "-show-region-summary" and "-show-instantiation-summary" to allow hiding those columns. "-show-instantiation-summary" is turned off by default. llvm-svn: 312969
* [llvm-cov] Don't attach exec counts to lines which start a skipped regionVedant Kumar2017-09-113-0/+16
| | | | | | | | | These lines by definition don't have an execution count. This is the final part of the fix for: https://bugs.llvm.org/show_bug.cgi?id=34166 llvm-svn: 312955
* Fixed a typo in llvm-cov/deferred-region.cpp test.Ilya Biryukov2017-09-111-1/+1
| | | | | | Input redirection was using `2&>1` instead of `2>&1`. llvm-svn: 312902
* [llvm-cov] Use portable output redirection in a testVedant Kumar2017-09-081-1/+1
| | | | | | A follow-up to a test fix (r312825). llvm-svn: 312826
* [llvm-cov] Try to appease a Windows botVedant Kumar2017-09-081-1/+1
| | | | | | | | | | | | | | | | On a Windows bot, I see a FileCheck error where the source being matched over no longer exists, i.e it seems like it's FileCheck'ing some stale output: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/4747 You can see "// CHECK: [[@LINE]]|{{ +}Marker at 19:3 = 1" in the FileCheck stderr, but that CHECK line doesn't exist. Remove the input file to FileCheck before running the test, to try and appease the bot. llvm-svn: 312825
* [llvm-cov] Disable name-compression in a test binaryVedant Kumar2017-09-081-0/+0
| | | | | | | | | | This should fix the lld bot: The Buildbot has detected a new failure on builder llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast while building cfe. Full details are available at: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/16993 llvm-svn: 312821
* [Coverage] Build sorted and unique segmentsVedant Kumar2017-09-082-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | A coverage segment contains a starting line and column, an execution count, and some other metadata. Clients of the coverage library use segments to prepare line-oriented reports. Users of the coverage library depend on segments being unique and sorted in source order. Currently this is not guaranteed (this is why the clang change which introduced deferred regions was reverted). This commit documents the "unique and sorted" condition and asserts that it holds. It also fixes the SegmentBuilder so that it produces correct output in some edge cases. Testing: I've added unit tests for some edge cases. I've also checked that the new SegmentBuilder implementation is fully covered. Apart from running check-profile and the llvm-cov tests, I've successfully used a stage1 llvm-cov to prepare a coverage report for an instrumented clang binary. Differential Revision: https://reviews.llvm.org/D36813 llvm-svn: 312817
* [llvm-cov] Fix a lifetime issueVedant Kumar2017-09-081-0/+4
| | | | | | | This fixes an issue where a std::string was moved to a constructor which accepted a StringRef. llvm-svn: 312816
* [Coverage] Report errors when reading malformed source regionsVedant Kumar2017-09-085-5/+8
| | | | | | | | | | | | | Each source region has a start and end location. Report an error when the end location does not precede the begin location. The old lineExecutionCounts.covmapping test actually had a buggy source region in it. This commit introduces a regenerated copy of the coverage and moves the old copy to malformedRegions.covmapping, for a test. Differential Revision: https://reviews.llvm.org/D37387 llvm-svn: 312814
* [llvm-cov] Unify region marker placement between text/html modesVedant Kumar2017-09-082-7/+50
| | | | | | | | | | | | Make sure that the text and html emitters always emit the same set of region markers, and avoid emitting redundant markers for line segments which don't end on the line they start on. This is related to D35925, and depends on D36014 Differential Revision: https://reviews.llvm.org/D36020 llvm-svn: 312813
* [llvm-cov] Read in function names for filtering from a text file.Sean Eveson2017-08-316-0/+101
| | | | | | | | | | | | | | Summary: Add a -name-whitelist option, which behaves in the same way as -name, but it reads in multiple function names from the given input file(s). Reviewers: vsk Reviewed By: vsk Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D37111 llvm-svn: 312227
* [llvm-cov] Add an option which maps the location of source directories on ↵Sean Eveson2017-08-1425-60/+73
| | | | | | | | | | | | | | | | | | | another machine to your local copies Summary: This patch adds the -path-equivalence option (example: llvm-cov show -path-equivalence=/origin/path,/local/path) which maps the source code path from one machine to another when using `llvm-cov show`. This is similar to the -filename-equivalence option, but doesn't require you to specify all the source files on the command line. This allows you to generate the coverage data on one machine (e.g. in a CI system), and then use llvm-cov on another machine where you have the same code base on a different path. Reviewers: vsk Reviewed By: vsk Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36391 llvm-svn: 310827
* [llvm-cov] Rearrange entries in report index.Eli Friedman2017-08-091-3/+4
| | | | | | | | | | | | | | Files which don't contain any functions are likely useless; don't include them in the main table. Put the links at the bottom of the page, in case someone wants to figure out coverage for code inside a macro. Not sure if this is the best solution, but it seems like an improvement. Differential Revision: https://reviews.llvm.org/D36298 llvm-svn: 310518
* [llvm-cov] Ignore unclosed line segments when setting line countsVedant Kumar2017-08-044-2/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes a slight change to the way llvm-cov determines line execution counts. If there are multiple line segments on a line, the line count is the max count among the regions which start *and* end on the line. This avoids an issue posed by deferred regions which start on the same line as a terminated region, e.g: if (false) return; //< The line count should be 0, even though a new region //< starts at the semi-colon. foo(); Another change is that counts from line segments which don't correspond to region entries are considered. This enables the first change, and corrects an outstanding issue (see the showLineExecutionCounts.cpp test change). This is related to D35925. Testing: check-profile, llvm-cov lit tests Differential Revision: https://reviews.llvm.org/D36014 llvm-svn: 310012
* [llvm-cov] Respect the value of the -show-instantiations optionVedant Kumar2017-08-021-0/+4
| | | | | | | Make `-show-instantiations=false` actually skip displaying instantiation sub-views, instead of simply ignoring the option. llvm-svn: 309903
* [llvm-cov] Allow specifying distinct architectures for each loaded binaryVedant Kumar2017-08-011-0/+9
| | | | | | | | | | | The coverage tool needs to know which slice to look at when it's handed a universal binary. Some projects need to look at aggregate coverage reports for a variety of slices in different binaries: this patch adds support for these kinds of projects to llvm-cov. rdar://problem/33579007 llvm-svn: 309747
* [llvm] Remove redundant check-prefix=CHECK from tests. NFC.Mandeep Singh Grang2017-07-171-2/+2
| | | | | | | | | | | | Reviewers: t.p.northover, oren_ben_simhon, niravd, mcrosier Reviewed By: oren_ben_simhon, mcrosier Subscribers: nhaehnle, javed.absar, llvm-commits Differential Revision: https://reviews.llvm.org/D35466 llvm-svn: 308193
* [llvm-cov] Disable threading in a test. NFC.Vedant Kumar2017-07-111-1/+1
| | | | | | | | | | | | PR30735 reports an issue where llvm-cov hangs with a worker thread waiting on a condition, and the main thread waiting to join() the workers. While this doesn't appear to be a bug in llvm-cov or the ThreadPool implementation, it would be helpful to disable the use of threading in the llvm-cov tests where no test coverage is added. More context: https://bugs.llvm.org/show_bug.cgi?id=30735 llvm-svn: 307610
* [llvm-cov] Add a cl::opt to control the number of threadsVedant Kumar2017-07-111-0/+11
| | | | | | | | | | When an output directory is specified, llvm-cov spawns some threads to speed up the process of writing out file reports. Add an option which allows users to control how many threads llvm-cov uses. A CommandGuide.rst update + test is included. llvm-svn: 307609
* [gcov] Sort file info before printing itVedant Kumar2017-04-2610-45/+45
| | | | | | | | | | | | | The order in which GCOV file info is printed depends on the string hash function. This makes some GCOV tests brittle, because the tests must be updated whenever the hash function changes. Sort the filenames before printing out the file info to solve the problem. This should be relatively cheap. Differential Revision: https://reviews.llvm.org/D32512 llvm-svn: 301371
* [llvm-cov] Error-out when an unsupported format is used (PR32087)Vedant Kumar2017-02-281-0/+2
| | | | llvm-svn: 296487
* [llvm-cov] Strip redundant path components from filenames (fix PR31982)Vedant Kumar2017-02-232-7/+13
| | | | | | | | | Instead of stripping the longest common prefix off of the filenames in a report, strip out the longest chain of redundant path components. This fixes the case in PR31982, where there are two files with the same prefix, and stripping out the LCP makes things less intelligible. llvm-svn: 296029
* [llvm-cov] Don't show function summaries when filtering by filename (fixes ↵Vedant Kumar2017-02-052-3/+3
| | | | | | PR31395) llvm-svn: 294137
* [llvm-cov] Demangle symbols in function summaries (fixes PR31394)Vedant Kumar2017-02-051-0/+3
| | | | llvm-svn: 294136
* [llvm-cov] Avoid 0% when reporting something that's 0/0Alex Lorenz2016-11-214-0/+38
| | | | | | | | | | | | | 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-022-55/+55
| | | | llvm-svn: 285853
* [llvm-cov] Add support for loading coverage from multiple objectsVedant Kumar2016-10-252-1/+12
| | | | | | Differential Revision: https://reviews.llvm.org/D25086 llvm-svn: 285088
* [llvm-cov] Do not print out the filename of the object fileVedant Kumar2016-10-258-15/+14
| | | | | | | | | 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] Filter away source files that aren't in the coverage mappingVedant Kumar2016-09-231-1/+2
| | | | | | | | ... so that they don't show up in the index. This came up because polly contains a .git directory and some other unmapped input in its source dir. llvm-svn: 282282
* [llvm-cov] Get rid of all invalid filename referencesVedant Kumar2016-09-231-4/+14
| | | | | | | | | | | | | | 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] Add the ability to specify directories of input source filesVedant Kumar2016-09-221-0/+9
| | | | | | | | | We've supported restricting coverage reports to a set of files for a long time. Add support for being able to restrict by entire directories. I suppose this supersedes D20803. llvm-svn: 282202
* [llvm-cov] Demangle names for hidden instantiation viewsVedant Kumar2016-09-201-3/+7
| | | | llvm-svn: 282020
* [llvm-cov] Delete the NonCodeLines field, it was always deadVedant Kumar2016-09-196-18/+18
| | | | llvm-svn: 281882
* [llvm-cov] Teach the coverage exporter about instantiation coverageVedant Kumar2016-09-196-0/+6
| | | | | | | While we're at it, re-use the logic from CoverageReport to compute summaries. llvm-svn: 281877
* [llvm-cov] Track function and instantiation coverage separatelyVedant Kumar2016-09-194-9/+28
| | | | | | | | | | | | | | | | | | | | 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] Drop another redundant 'No.' suffixVedant Kumar2016-09-191-1/+1
| | | | llvm-svn: 281872
* [llvm-cov] Hide instantiation views for unexecuted functionsVedant Kumar2016-09-152-0/+26
| | | | | | | | 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-0/+4
| | | | | | | Doing so is pointless, since the whole view is usually visible in a small amount of space. llvm-svn: 281588
* [llvm-cov] Don't print a verbose title when looking at one fileVedant Kumar2016-09-151-2/+2
| | | | | | | Having the same title, timestamp, etc. occur repeatedly creates an unnecessary distraction when paging through a report. llvm-svn: 281579
* [llvm-cov] Fix tests that aren't checking anything (NFC)Vedant Kumar2016-09-153-28/+24
| | | | | | | E.g the 'showProjectSummary' test contains some checks which can't fail because they match themselves... llvm-svn: 281578
* [llvm-cov] Just emit the version number in the index fileVedant Kumar2016-09-131-6/+6
| | | | | | | 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-7/+11
| | | | | | | | | | 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-6/+5
| | | | | | | Having it in the same row as the source name is jarring. Move it next to the "Source" column label. llvm-svn: 281146
OpenPOWER on IntegriCloud