Commit Graph

10 Commits

Author SHA1 Message Date
Pirama Arumuga Nainar
c41549f3d2 Add acov-llvm.py script
Bug: http://b/160401633

This is a tool for gathering coverage information from a device and
generating an LLVM coverage report from that information.  See top of
the file for usage instructions.

Also redirect acov users to acov-llvm when CLANG_COVERAGE is set.

Test: acov-llvm.py wih clean-device, flush and report subcommands.

Change-Id: I5dba3a669bb6ac2797093903536f346228625c05
2021-03-30 14:58:06 -07:00
Roland Levillain
0fb7707b2d Rename native code coverage paths environment variable in acov.
Rename `COVERAGE_PATHS` as `NATIVE_COVERAGE_PATHS`.

Test: n/a
Bug: 158212027
Change-Id: Ifbf4bed29880cd169aaca63733420f260cf6551d
2020-06-10 12:53:49 +01:00
Oliver Nguyen
f7421ae9db Update acov script to handle new coverage file locations.
Test: Build with native coverage and run acov, check report contents.
Change-Id: I47afd35216cfcc7df7da2378cccdf8dba23bd8e2
2020-03-11 10:54:07 -07:00
Dan Albert
f1d27e2c9a Allow acov --prep to succeed in a clean build.
Change-Id: I8f72da827d660f9aad051738a8287463dccd0619
2015-04-14 13:46:57 -07:00
Dan Albert
f12f658224 Default to using clang compatible gcov for host.
Also adds the ability to pass arbitrary arguments to lcov, in case the
user needs to override this behavior.

Change-Id: I66b842f92f546fee17a7f1033ef590a3380c14c4
2015-01-29 17:00:16 -08:00
Dan Albert
6c3911d1a7 Merge "Add support for host coverage." 2015-01-24 21:53:01 +00:00
Dan Albert
72324d80f6 Add support for host coverage.
The --host flag will pull coverage results from the host output rather
than the target.

Change-Id: I88aac17d23feff22926fbb67416ade3c821b5b6c
2015-01-24 13:47:03 -08:00
Dan Albert
cf347cc5a4 Add acov --clean and acov --prep.
The --clean flag clears ANDROID_PRODUCT_OUT and ANDROID_HOST_OUT of
all coverage files. If a source file that had a coverage notes file
(a .gcno) generated for it is renamed or removed, the build system
will not clean the old file, which means the coverage tool will still
try to find coverage data.

The --prep flag clears just coverage data files. This should be done
before any coverage run, as you don't want old coverage data affecting
your results.

Change-Id: Id68395d19369eba4589daff90461a10cf7aef66d
2015-01-24 13:45:58 -08:00
Dan Albert
7d133d23f9 Silence lcov existence test output.
Change-Id: I72ea929c8358d82c5653d7b475a35ddcb918dac0
2014-09-25 11:23:30 -07:00
Dan Albert
98e2c644f2 Add acov for coverage gathering/reporting.
acov is a tool for gathering coverage information from a device and
generating a report from that information. To use:

1. sudo apt-get install lcov
2. Build application/library with coverage information.
3. Push the new binaries to the device.
4. Run tests with the additional environment variables:
    * GCOV_PREFIX=/data/local/tmp/gcov
    * GCOV_PREFIX_STRIP=`echo $(ANDROID_BUILD_TOP) | grep -o / | wc -l`
5. Run `acov`.

acov will pull all coverage information from the device, push it to the
right directories, run lcov, and display the coverage report (currently
by opening it in your browser).

Bug: 10134489
Change-Id: I604c8ec2e9fa5d23ee9c279b515ff6cfc497dfa7
2014-09-22 09:15:45 -07:00