而不是多次运行C

而不是多次运行C

本文介绍了如何在一个.travis.yml中测试Python和C ++,而不是多次运行C ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎没有真正的帮助。我有这个.travis.yml为libais:

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)

脚本的最后一行触发c ++测试。

The last line of the script triggers the c++ testing.

它是伟大的,它运行libais gunit C ++测试,但可惜的是,他们运行2x。一次为每个python版本。我不想添加额外的负载到travis-ci。

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?

推荐答案

根据Dominic的回答,我观察了,并找到TRAVIS_PYTHON_VERSION。所以不需要任何文件。

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

这篇关于如何在一个.travis.yml中测试Python和C ++,而不是多次运行C ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 16:36