blob: 8fe75c5cd5e62b510e3cfe8bce7381d07d581622 [file] [log] [blame]
# Run from Skia trunk something like this:
# $ tools/ tests
# or
# $ tools/ gm
set -x
set -e
GCOV=$(realpath tools/gcov_shim)
# Build all of Skia.
ninja -C out/Coverage
# Generate a zero-baseline so files not covered by $COMMAND will still show up in the report.
# This reads the .gcno files that are created at compile time.
lcov $QUIET --gcov-tool=$GCOV -c -b out/Coverage -d out/Coverage -o /tmp/baseline -i
# Running the binary generates the real coverage information, the .gcda files.
lcov $QUIET --gcov-tool=$GCOV -c -b out/Coverage -d out/Coverage -o /tmp/coverage
lcov $QUIET -a /tmp/baseline -a /tmp/coverage -o /tmp/merged
genhtml $QUIET /tmp/merged --legend -o out/Coverage/report
xdg-open out/Coverage/report/index.html