travis: Separate compiling and testing

This commit is contained in:
patrick96 2018-04-08 00:49:51 +02:00 committed by Patrick Ziegler
parent eed4d3ffc8
commit d768c49980
5 changed files with 46 additions and 32 deletions

View File

@ -2,9 +2,36 @@ sudo: required
dist: trusty
language: cpp
compiler:
- clang
- gcc
env:
global:
- LLVM_VERSION="3.8.1"
- LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz"
- LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz"
- LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz"
- CMAKE_URL="https://cmake.org/files/v3.6/cmake-3.6.2-Linux-x86_64.tar.gz"
- PYTHONPATH="/usr/lib/python2.7/dist-packages:${PYTHONPATH}"
- JOBS=4
- POLYBAR_BUILD_TYPE="compile"
script: source ${TRAVIS_BUILD_DIR}/common/travis/build.sh
matrix:
include:
- compiler: clang
env: BUILD_TYPE=Release
- compiler: clang
env: BUILD_TYPE=Debug
- compiler: gcc
env: BUILD_TYPE=Debug POLYBAR_BUILD_TYPE=tests
script: ${TRAVIS_BUILD_DIR}/common/travis/tests.sh
- compiler: gcc
env: BUILD_TYPE=Release
- compiler: gcc
env: BUILD_TYPE=Debug
addons:
apt:
@ -37,17 +64,6 @@ addons:
- xutils-dev
- libgtest-dev
env:
global:
- BUILD_TESTS="ON"
- LLVM_VERSION="3.8.1"
- LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz"
- LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz"
- LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz"
- CMAKE_URL="https://cmake.org/files/v3.6/cmake-3.6.2-Linux-x86_64.tar.gz"
- PYTHONPATH="/usr/lib/python2.7/dist-packages:${PYTHONPATH}"
- JOBS=4
cache:
directories:
- ${TRAVIS_BUILD_DIR}/deps/cmake
@ -66,10 +82,6 @@ before_script:
- source ${TRAVIS_BUILD_DIR}/common/travis/summary.sh
- source ${TRAVIS_BUILD_DIR}/common/travis/configure.sh
script:
- source ${TRAVIS_BUILD_DIR}/common/travis/build.sh
- source ${TRAVIS_BUILD_DIR}/common/travis/tests.sh
notifications:
email: false
irc:

View File

@ -5,4 +5,5 @@ cmake \
-DCMAKE_C_COMPILER="${CC}" \
-DCMAKE_CXX_COMPILER="${CXX}" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DBUILD_TESTS:BOOL="${BUILD_TESTS:-OFF}" ..

View File

@ -7,7 +7,4 @@ if [ "${CXX:0:7}" = "clang++" ]; then
elif [ "${CXX:0:3}" = "g++" ]; then
export CXX="g++-5"
export CC="gcc-5"
elif [ "${CXX:0:3}" = "gcc" ]; then
export CXX="g++-5"
export CC="gcc-5"
fi

View File

@ -9,6 +9,9 @@ echo "cmake --version"
cmake --version
echo "PATH=${PATH}"
echo "CXX=${CXX}"
echo "CC=${CC}"
echo "CXXFLAGS=${CXXFLAGS}"
echo "LDFLAGS=${LDFLAGS}"
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"
echo "JOBS=${JOBS}"

View File

@ -1,15 +1,16 @@
#!/bin/bash
r=0
if [ "${BUILD_TESTS:-OFF}" = "ON" ]; then
for test in tests/unit_test.*; do
[ -x "$test" ] || continue
if $test; then
printf "\033[1;32m%s\033[0m\n" "${test##*/} passed"
else
r=1
printf "\033[1;31m%s\033[0m\n" "${test##*/} failed"
fi
done
fi
make -j"${JOBS}" all_unit_tests
for test in tests/unit_test.*; do
[ -x "$test" ] || continue
if $test; then
printf "\033[1;32m%s\033[0m\n" "${test##*/} passed"
else
r=1
printf "\033[1;31m%s\033[0m\n" "${test##*/} failed"
fi
done
exit $r