Merge pull request #8 from ctiller/gcov

Tools to generate coverage reports
pull/23/head
Nicolas Noble 10 years ago
commit 3eb079dcad
  1. 2
      .gitignore
  2. 9
      Makefile
  3. 9
      templates/Makefile.template
  4. 18
      tools/run_tests/run_lcov.sh
  5. 1
      tools/run_tests/run_tests.py

2
.gitignore vendored

@ -1,5 +1,7 @@
bins
coverage
deps
*.gcno
gens
libs
objs

@ -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.

@ -66,6 +66,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

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

Loading…
Cancel
Save