Reputation: 2698
https://github.com/travis-ci/travis-ci/issues/538 doesn't seem to really help. I have this .travis.yml for libais:
language: python
python:
- "2.7"
- "3.4"
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
install:
- sudo apt-get install -qq gcc-4.8 g++-4.8
- CC=g++-4.8 python setup.py install
script:
- python setup.py test
- (cd src && CC=gcc-4.8 CXX=g++-4.8 make -f Makefile-custom test)
The last line of the script triggers the c++ testing.
It's great that it runs the libais gunit C++ tests, but sadly, they get run 2x. Once for each python version. I'd prefer not to add the additional load to travis-ci. Is there a way to do that?
Upvotes: 2
Views: 1428
Reputation: 2698
Based on Dominic's answer, I looked at http://docs.travis-ci.com/user/ci-environment/ and found TRAVIS_PYTHON_VERSION. So no need to fiddle with any files.
script:
- python setup.py test
- if [[ $TRAVIS_PYTHON_VERSION == '3.4' ]]; then (cd src && CC=gcc-4.8 CXX=g++-4.8 make -f Makefile-custom test); fi
Upvotes: 2
Reputation: 2538
A quick idea: maybe you could do a check for the existence of a file before deciding to run your C++ tests?
E.g.
- [[ -f $FILE ]] || (cd src && CC=gcc-4.8 CXX=g++-4.8 make -f Makefile-custom test)
The file to check for could be for example the report of your C++ unit tests. If it's already there, don't run them a second time.
Upvotes: 1