File: test_coverage.sh

package info (click to toggle)
kdb 3.2.0-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,276 kB
  • sloc: cpp: 38,360; yacc: 940; python: 779; sh: 711; ansic: 440; lex: 367; xml: 182; sql: 51; makefile: 10
file content (22 lines) | stat: -rwxr-xr-x 729 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

# Inspiration from https://itk.org/gitweb?p=ITK.git;a=blob;f=Utilities/Maintenance/computeCodeCoverageLocally.sh;h=539e6c62c2dc2ba9f7c16b915120915fe192f67a;hb=HEAD

CMAKE_BINARY_DIR=`grep ^CMAKE_BINARY_DIR Makefile | sed 's/.*\= //'`
CMAKE_SOURCE_DIR=`grep ^CMAKE_SOURCE_DIR Makefile | sed 's/.*\= //'`

echo CMAKE_BINARY_DIR = $CMAKE_BINARY_DIR
echo CMAKE_SOURCE_DIR = $CMAKE_SOURCE_DIR

cd $CMAKE_BINARY_DIR/src

rm -f app.info app.info2

lcov --directory . --zerocounters 

ctest || exit 1

lcov --directory . -b $CMAKE_SOURCE_DIR/src/parser --capture --output-file app.info || exit 1
lcov --remove app.info '/usr/*' --output-file  app.info2 || exit 1

genhtml --legend -f --demangle-cpp -o gcov_report app.info2