travis: Separate compiling and testing
This commit is contained in:
parent
eed4d3ffc8
commit
d768c49980
48
.travis.yml
48
.travis.yml
@ -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:
|
||||
|
@ -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}" ..
|
||||
|
@ -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
|
||||
|
@ -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}"
|
||||
|
@ -1,6 +1,8 @@
|
||||
#!/bin/bash
|
||||
r=0
|
||||
if [ "${BUILD_TESTS:-OFF}" = "ON" ]; then
|
||||
|
||||
make -j"${JOBS}" all_unit_tests
|
||||
|
||||
for test in tests/unit_test.*; do
|
||||
[ -x "$test" ] || continue
|
||||
|
||||
@ -11,5 +13,4 @@ if [ "${BUILD_TESTS:-OFF}" = "ON" ]; then
|
||||
printf "\033[1;31m%s\033[0m\n" "${test##*/} failed"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
exit $r
|
||||
|
Loading…
Reference in New Issue
Block a user