Модульные тесты C ++ пройдены, но сборка завершается с 1 - PullRequest
0 голосов
/ 13 февраля 2020

Ниже приведены мои настройки 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.
...