Skip to content

Commit 9eaa545

Browse files
committed
Provide wrapper script for the gcov-tool.
1 parent e600f6b commit 9eaa545

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

.github/workflows/linux.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
env:
2222
COMPILER: ${{ matrix.compiler }}
2323
TEST_TYPE: ${{ matrix.test_type }}
24+
OS: ${{ matrix.os }}
2425

2526
strategy:
2627
matrix:
@@ -61,6 +62,7 @@ jobs:
6162
make do-test-cmake
6263
6364
- name: Coveralls Parallel
65+
if: matrix.os != 'ubuntu-20.04' || matrix.compiler != 'clang'
6466
uses: coverallsapp/github-action@master
6567
with:
6668
github-token: ${{ secrets.GITHUB_TOKEN }}

GNUmakefile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,21 +121,25 @@ do-test:
121121
MGW64_PREF="${MGW64_PREF}" sh -x ./scripts/do-test.sh
122122
env ${TT_VAR} sh -x ./scripts/do-test-run.sh
123123
ifdef CI_COVERAGE
124-
mkdir digger_lcov
125-
if [ $(CC) = "gcc" ]; then GCOV_CMD="gcov"; else GCOV_CMD="llvm-cov gcov"; llvm-cov --version; fi; \
126-
lcov --directory . --capture --output-file digger_lcov/digger.info \
127-
--gcov-tool "$${GCOV_CMD}"
124+
if [ "${OS}" != "ubuntu-20.04" -o "${COMPILER}" != "clang" ]; \
125+
then \
126+
mkdir digger_lcov; \
127+
lcov --directory . --capture --output-file digger_lcov/digger.info \
128+
--gcov-tool ${GITHUB_WORKSPACE}/scripts/gen-test-coverage.sh; \
129+
fi
128130
endif
129131

130132
do-test-cmake:
131133
sh -x ./scripts/do-test-cmmn.sh
132134
sh -x ./scripts/do-test-cmake.sh
133135
env ${TT_VAR} sh -x ./scripts/do-test-run.sh
134136
ifdef CI_COVERAGE
135-
mkdir digger_lcov
136-
if [ $(CC) = "gcc" ]; then GCOV_CMD="gcov"; else GCOV_CMD="llvm-cov gcov"; llvm-cov --version; fi; \
137-
lcov --directory . --capture --output-file digger_lcov/digger.info \
138-
--gcov-tool "$${GCOV_CMD}"
137+
if [ "${OS}" != "ubuntu-20.04" -o "${COMPILER}" != "clang" ]; \
138+
then \
139+
mkdir digger_lcov; \
140+
lcov --directory . --capture --output-file digger_lcov/digger.info \
141+
--gcov-tool ${GITHUB_WORKSPACE}/scripts/gen-test-coverage.sh; \
142+
fi
139143
endif
140144

141145
coverage-report:

scripts/gen-test-coverage.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
if [ "${CC}" = "clang" ]
6+
then
7+
echo llvm-cov gcov "${@}" >&2
8+
exec llvm-cov gcov "${@}"
9+
fi
10+
echo gcov "${@}" >&2
11+
exec gcov "${@}"
12+

0 commit comments

Comments
 (0)