How to test both Python and C++ in one .travis.yml without running the C++ multiple times?

放肆的年华 提交于 2019-12-06 07:55:58

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!