Skip to content

Commit 5d718e1

Browse files
committed
Move common code to "coverage.bash"
1 parent 934e4cd commit 5d718e1

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

coverage.bash

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash -ex
2+
#
3+
# Run tests with coverage reporting enabled.
4+
5+
export CXXFLAGS='-coverage'
6+
export LDFLAGS='-coverage'
7+
8+
rm -f CMakeCache.txt
9+
rm -rf CMakeFiles
10+
11+
cmake -D CMAKE_BUILD_TYPE=Debug .
12+
13+
make check

coveralls.bash

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
#!/bin/bash -ex
22
#
3-
# Run tests with coverage reporting enabled.
3+
# Run tests for Coveralls.
44

5-
export CXXFLAGS='-coverage'
6-
export LDFLAGS='-coverage'
5+
./coverage.bash
76

8-
rm -f CMakeCache.txt
9-
rm -rf CMakeFiles
10-
11-
cmake -D CMAKE_BUILD_TYPE=Debug .
12-
13-
make check
14-
15-
# For Coveralls.
167
path=$PWD
178
for f in *.cpp *.h
189
do

lcov.bash

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash -ex
2+
#
3+
# Run tests with coverage reporting enabled.
4+
5+
./coverage.bash
6+
7+
# Create HTML report.
8+
lcov --directory='CMakeFiles/perceptualdiff.dir' --output-file='lcov_tmp.info' --capture
9+
lcov --output-file='lcov.info' --extract 'lcov_tmp.info' "$(pwd)/*"
10+
genhtml --output-directory='coverage_output' lcov.info
11+
12+
# Remove intermediate lcov output.
13+
rm 'lcov_tmp.info'
14+
15+
python -m webbrowser -n "file://${PWD}/coverage_output/index.html"

0 commit comments

Comments
 (0)