C ++单元测试已通过,但使用1

时间:2020-02-13 01:54:43

标签: c++ cmake travis-ci

以下是我的Travis CI设置。我使用Catch2进行单元测试,并通过了所有单元测试。在Travis上也可以观察到相同的结果,但是,构建本身总是以1退出。

dist: trusty
sudo: required
language:
  - cpp
compiler:
  - gcc
addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - gcc-6
      - g++-6
      - cmake
script:
  - ln -s /usr/bin/gcc-6 /usr/local/bin/gcc
  - ln -s /usr/bin/g++-6 /usr/local/bin/g++
  - export CC=/usr/bin/gcc-6
  - export CXX=/usr/bin/g++-6
  - gcc -v && g++ -v && cmake --version
  - mkdir build
  - cd build
  - cmake ..
  - make
  - ./tests/tests

我的Travis脚本找不到问题。以下是构建的输出。如您所见,所有20个断言都是正确的。

0.00s$ mkdir build
The command "mkdir build" exited with 0.
0.00s$ cd build
The command "cd build" exited with 0.
0.72s$ cmake ..
-- The CXX compiler identification is GNU 6.5.0
-- Check for working CXX compiler: /usr/bin/g++-6
-- Check for working CXX compiler: /usr/bin/g++-6 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The C compiler identification is GNU 6.5.0
-- Check for working C compiler: /usr/bin/gcc-6
-- Check for working C compiler: /usr/bin/gcc-6 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/travis/build/CodeAndChoke/introduction-to-algorithms/build
The command "cmake .." exited with 0.
8.56s$ make
Scanning dependencies of target algorithms
[ 20%] Building CXX object src/CMakeFiles/algorithms.dir/insertionsort.cpp.o
[ 40%] Building CXX object src/CMakeFiles/algorithms.dir/linearsearch.cpp.o
[ 60%] Linking CXX static library libalgorithms.a
[ 60%] Built target algorithms
Scanning dependencies of target tests
[ 80%] Building CXX object tests/CMakeFiles/tests.dir/tests.cpp.o
[100%] Linking CXX executable tests
[100%] Built target tests
The command "make" exited with 0.
0.00s$ ./tests/tests
===============================================================================
All tests passed (20 assertions in 2 test cases)
The command "./tests/tests" exited with 0.

Done. Your build exited with 1.

0 个答案:

没有答案