Add tools/run_tests/run_lcov.sh

This is a tool for collecting coverage reports from our tests and
combining them with the open-source tool 'lcov'.
pull/8/head
Craig Tiller 10 years ago
parent 9fef05c2f0
commit 934baa3bb1
  1. 1
      .gitignore
  2. 9
      Makefile
  3. 18
      tools/run_tests/run_lcov.sh
  4. 1
      tools/run_tests/run_tests.py

1
.gitignore vendored

@ -3,4 +3,5 @@ deps
libs
objs
*.pyc
*.gcno

@ -49,6 +49,15 @@ CPPFLAGS_msan = -O1 -fsanitize=memory -fno-omit-frame-pointer
LDFLAGS_msan = -fsanitize=memory
DEFINES_msan = NDEBUG
VALID_CONFIG_gcov = 1
CC_gcov = gcc
CXX_gcov = g++
LD_gcov = gcc
LDXX_gcov = g++
CPPFLAGS_gcov = -O0 -fprofile-arcs -ftest-coverage
LDFLAGS_gcov = -fprofile-arcs -ftest-coverage
DEFINES_gcov = NDEBUG
# General settings.
# You may want to change these depending on your system.

@ -0,0 +1,18 @@
#!/bin/bash
set -ex
out=`realpath ${1:-coverage}`
root=`realpath $(dirname $0)/../..`
tmp=`mktemp`
cd $root
tools/run_tests/run_tests.py -c gcov
lcov --capture --directory . --output-file $tmp
genhtml $tmp --output-directory $out
rm $tmp
if which xdg-open > /dev/null
then
xdg-open file://$out/index.html
fi

@ -37,6 +37,7 @@ _CONFIGS = {
'tsan': SimpleConfig('tsan'),
'msan': SimpleConfig('msan'),
'asan': SimpleConfig('asan'),
'gcov': SimpleConfig('gcov'),
'valgrind': ValgrindConfig('dbg'),
}

Loading…
Cancel
Save