Skip to content

Commit 959644b

Browse files
author
Clement Champetier
committed
Travis: fix capture coverage with nosetests option
* Add env variable for avtranscoder build directory. * Add env variable for avtranscoder install directory. * Fix capture of coverage in the avtranscoder install directory.
1 parent a7828d7 commit 959644b

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

.travis.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
env:
2+
global:
3+
- AVTRANSCODER_BUILD=${TRAVIS_BUILD_DIR}/build
4+
- AVTRANSCODER_INSTALL=${TRAVIS_BUILD_DIR}/install
25
matrix:
36
- DEPENDENCY_MODE=libav
47
- DEPENDENCY_MODE=ffmpeg
@@ -19,35 +22,36 @@ before_script:
1922
- uname -a
2023

2124
- cd ${TRAVIS_BUILD_DIR}
22-
# install latest LCOV (1.9 was failing for me) [1]
25+
# install latest LCOV (1.9 was failing for me)
2326
- wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz
2427
- tar xf lcov_1.11.orig.tar.gz
2528
- sudo make -C lcov-1.11/ install
2629
# install lcov to coveralls conversion + upload tool
2730
- gem install coveralls-lcov
2831
# init coverage to 0 (optional)
29-
- lcov --directory . --zerocounters
32+
- lcov --directory ${AVTRANSCODER_BUILD} --zerocounters
33+
# install nosetests plugins
34+
- sudo pip install coverage
3035

3136
# install avtranscoder dependencies
3237
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./tools/travis.linux.install.deps.sh; fi
3338
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then ./tools/travis.osx.install.deps.sh; fi
3439

3540
script:
36-
- cd ${TRAVIS_BUILD_DIR}
3741
# Build
38-
- mkdir build
39-
- cd build
40-
- cmake .. -DCMAKE_INSTALL_PREFIX=`pwd`/install -DCMAKE_BUILD_TYPE=Debug
42+
- mkdir -p ${AVTRANSCODER_BUILD}
43+
- cd ${AVTRANSCODER_BUILD}
44+
- cmake .. -DCMAKE_INSTALL_PREFIX=${AVTRANSCODER_INSTALL} -DCMAKE_BUILD_TYPE=Release -DAVTRANSCODER_COVERAGE=True
4145
- make install
4246
# Launch tests
4347
- if [ "${TRAVIS_OS_NAME}" = "linux" && "${DEPENDENCY_MODE}" = "ffmpeg" ]; then ./../tools/travis.python.nosetests.sh; fi
4448

4549
after_success:
4650
- cd ${TRAVIS_BUILD_DIR}
4751
# capture coverage info
48-
- lcov --directory . --capture --output-file coverage.info
52+
- lcov --capture --directory ${AVTRANSCODER_BUILD} --output-file coverage.info
4953
# filter out system and test code
50-
- lcov --remove coverage.info 'tests/*' '/usr/*' --output-file coverage.info
54+
- lcov --remove coverage.info '/usr/*' '*/*PYTHON_wrap.*' --output-file coverage.info
5155
# debug before upload
5256
- lcov --list coverage.info
5357
# uploads to coveralls

tools/travis.python.nosetests.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

33
# Get avtranscoder library
4-
export PYTHONPATH=`pwd`/build/install/lib/python2.7.6/site-packages/:$PYTHONPATH
4+
export PYTHONPATH=${AVTRANSCODER_INSTALL}/lib/python2.7.6/site-packages/:$PYTHONPATH
55

66
# Get avtranscoder profiles
7-
export AVPROFILES=`pwd`/build/install/share/ressource
7+
export AVPROFILES=${AVTRANSCODER_INSTALL}/share/ressource
88

99
# Get assets
1010
git clone https://github.com/avTranscoder/avTranscoder-data.git
@@ -13,5 +13,4 @@ export AVTRANSCODER_TEST_AUDIO_WAVE_FILE=`pwd`/avTranscoder-data/audio/frequenci
1313
export AVTRANSCODER_TEST_AUDIO_MOV_FILE=`pwd`/avTranscoder-data/video/BigBuckBunny/BigBuckBunny_1080p_5_1.mov
1414

1515
# Launch tests
16-
cd test/pyTest
17-
nosetests
16+
nosetests ${TRAVIS_BUILD_DIR}/test/pyTest --with-coverage

0 commit comments

Comments
 (0)