Skip to content

Commit a700ea3

Browse files
author
Clement Champetier
committed
Travis: install & generate coverage only with gcc compiler
Install & generate coverage in separate script files.
1 parent e930a74 commit a700ea3

File tree

3 files changed

+31
-18
lines changed

3 files changed

+31
-18
lines changed

.travis.yml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,9 @@ before_script:
2323
- uname -a
2424

2525
- cd ${TRAVIS_BUILD_DIR}
26-
# install latest LCOV (1.9 was failing for me)
27-
- wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz
28-
- tar xf lcov_1.11.orig.tar.gz
29-
- sudo make -C lcov-1.11/ install
30-
# install lcov to coveralls conversion + upload tool
31-
- gem install coveralls-lcov
32-
# init coverage to 0 (optional)
33-
- lcov --directory ${AVTRANSCODER_BUILD} --zerocounters
34-
# install nosetests plugins
35-
- sudo pip install coverage
26+
27+
# install coverage tools used by gcc compiler
28+
- if [ "${CC}" = "gcc" ]; then ./tools/travis.gcc.install.coverage.sh; fi
3629

3730
# install avtranscoder dependencies
3831
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./tools/travis.linux.install.deps.sh; fi
@@ -44,16 +37,12 @@ script:
4437
- cd ${AVTRANSCODER_BUILD}
4538
- cmake .. -DCMAKE_INSTALL_PREFIX=${AVTRANSCODER_INSTALL} -DCMAKE_BUILD_TYPE=Release -DAVTRANSCODER_COVERAGE=True
4639
- make $J install
40+
4741
# Launch tests
4842
- if [ "${DEPENDENCY_MODE}" = "ffmpeg" ]; then ./../tools/travis.python.nosetests.sh; fi
4943

5044
after_success:
5145
- cd ${TRAVIS_BUILD_DIR}
52-
# capture coverage info
53-
- lcov --capture --directory ${AVTRANSCODER_BUILD} --output-file coverage.info
54-
# filter out system and test code
55-
- lcov --remove coverage.info '/usr/*' '*/*PYTHON_wrap.*' --output-file coverage.info
56-
# debug before upload
57-
- lcov --list coverage.info
58-
# uploads to coveralls
59-
- coveralls-lcov --repo-token e7jYJJrojzWYfmdUgkDvwVNGqJgh6yCH7 coverage.info
46+
47+
# generate coverage for coveralls
48+
- if [ "${CC}" = "gcc" ]; then ./tools/travis.gcc.generate.coverage.sh; fi

tools/travis.gcc.generate.coverage.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# capture coverage info
2+
lcov --capture --directory ${AVTRANSCODER_BUILD} --output-file coverage.info
3+
4+
# filter out system and test code
5+
lcov --remove coverage.info '/usr/*' '*/*PYTHON_wrap.*' --output-file coverage.info
6+
7+
# debug before upload
8+
lcov --list coverage.info
9+
10+
# uploads to coveralls
11+
coveralls-lcov --repo-token e7jYJJrojzWYfmdUgkDvwVNGqJgh6yCH7 coverage.info

tools/travis.gcc.install.coverage.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# install latest LCOV (1.9 was failing for me)
2+
wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz
3+
tar xf lcov_1.11.orig.tar.gz
4+
sudo make -C lcov-1.11/ install
5+
6+
# install lcov to coveralls conversion + upload tool
7+
gem install coveralls-lcov
8+
9+
# init coverage to 0 (optional)
10+
lcov --directory ${AVTRANSCODER_BUILD} --zerocounters
11+
12+
# install nosetests plugins
13+
sudo pip install coverage

0 commit comments

Comments
 (0)