简体   繁体   English

Travis-Ci安装并运行CxxTest

[英]Travis-Ci Install and run CxxTest

I am trying to add Travis-Ci support for my open source project hosted on Github 我正在尝试为我在Github上托管的开源项目添加Travis-Ci支持

Problem appears when CMake tries to find CxxTest . CMake尝试查找CxxTest时出现问题。 Travis-Ci runs on old Ubuntu version, in which CxxTest is not trusted. Travis-Ci运行在旧的Ubuntu版本上,其中CxxTest不受信任。 I achieved some results. 我取得了一些成果。 At this state CxxTest installs fine, but CMake is unable to find cxxtestgen . 在这种状态CxxTest安装正常,但CMake无法找到cxxtestgen

Question: How do I correctly install and use CxxTest in Travis-Ci ? 问题:如何在Travis-Ci正确安装和使用CxxTest

Build log on Travis 在Travis上构建日志

Travis.yml Travis.yml

language: cpp

compiler:
  - gcc
before_install:
  - lsb_release -c
  - lsb_release -r
  - sudo apt-add-repository 'deb http://archive.ubuntu.com/ubuntu vivid main universe multiverse restricted'
  - sudo apt-add-repository 'deb http://archive.ubuntu.com/ubuntu trusty main universe multiverse restricted'
  - sudo apt-key update
  - sudo apt-get -y update
install:
  - sudo apt-get --no-install-recommends -y install cxxtest;
  - sudo find / -type f -name "cxxtestgen*"
  - sudo ln /usr/share/cxxtest/cxxtest/cxxtestgen.py /usr/bin/cxxtestgen.py
  - sudo find / -type f -name "cxxtestgen*"
  - echo $PATH
before_script:
  - cmake .
script: make

CMake log CMake日志

$ cmake .
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
  Could NOT find CxxTest (missing: CXXTEST_PERL_TESTGEN_EXECUTABLE)
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-2.8/Modules/FindCxxTest.cmake:179 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  test/CMakeLists.txt:5 (find_package)
-- Configuring incomplete, errors occurred!
The command "cmake ." failed and exited with 1 during .
Your build has been stopped.

I found answer by myself. 我自己找到了答案。

language: cpp

compiler:
  - gcc

cache:
  apt: true

addons:
  apt:
    sources:
    - ubuntu-toolchain-r-test
    - george-edison55/cmake-3.x
    packages:
    - gcc-6
    - g++-6
    - libboost-dev
    - gcc-multilib
    - gcc-6-multilib
    - g++-multilib
    - g++-6-multilib
    - libc6-dev-i386
    - libc6-i386
    - cxxtest
    - cmake

before_install:
  - echo `getconf _NPROCESSORS_ONLN`
  - lsb_release -c
  - lsb_release -r
install:
  - if [ "$CXX" = "g++" ]; then export CXX="g++-6" CC="gcc-6"; fi
before_script:
  - cmake --version
  - cmake .
script: 
  - make -j$((2 * `getconf _NPROCESSORS_ONLN`))

sudo: false
dist: trusty

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM