gpt4 book ai didi

c++ - Travis-Ci 安装并运行 CxxTest

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:22:07 27 4
gpt4 key购买 nike

我正在尝试为我的 open source project hosted on Github 添加 Travis-Ci 支持

CMake 尝试查找 CxxTest 时出现问题。 Travis-Ci 在旧的 Ubuntu 版本上运行,其中 CxxTest 不受信任。我取得了一些成果。在此状态下,CxxTest 安装正常,但 CMake 无法找到 cxxtestgen

问题:如何在Travis-Ci中正确安装和使用CxxTest

Build log on 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 日志

$ 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.

最佳答案

我自己找到了答案。

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

关于c++ - Travis-Ci 安装并运行 CxxTest,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41693514/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com