Add cmake and clang build to travis

This commit is contained in:
seelabs
2016-06-17 11:10:33 -04:00
committed by Vinnie Falco
parent 28bd98073e
commit bc1eca81df
3 changed files with 71 additions and 31 deletions

View File

@@ -2,6 +2,7 @@ language: cpp
env:
global:
- LLVM_VERSION=3.8.0
# Maintenance note: to move to a new version
# of boost, update both BOOST_ROOT and BOOST_URL.
# Note that for simplicity, BOOST_ROOT's final
@@ -27,22 +28,6 @@ packages: &gcc5_pkgs
- autotools-dev
- libc6-dbg
packages: &clang38_pkgs
- clang-3.8
- g++-5
- python-software-properties
- libssl-dev
- libffi-dev
- libstdc++6
- binutils-gold
# Provides a backtrace if the unittests crash
- gdb
# Needed for installing valgrind
- subversion
- automake
- autotools-dev
- libc6-dbg
matrix:
include:
# GCC/Coverage
@@ -53,6 +38,16 @@ matrix:
sources: ['ubuntu-toolchain-r-test']
packages: *gcc5_pkgs
# GCC/Debug/CMake
- compiler: gcc
env:
- GCC_VER=5
- VARIANT=debug
- ADDRESS_MODEL=64
- BUILD_SYSTEM=cmake
- PATH=$PWD/cmake/bin:$PATH
addons: *ao_gcc5
# # GCC/Debug
# - compiler: gcc
# env: GCC_VER=5 VARIANT=debug ADDRESS_MODEL=64
@@ -63,21 +58,31 @@ matrix:
# Clang/UndefinedBehaviourSanitizer
- compiler: clang
env: GCC_VER=5 VARIANT=usan CLANG_VER=3.8 ADDRESS_MODEL=64 UBSAN_OPTIONS='print_stacktrace=1'
addons: &ao_clang38
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.8']
packages: *clang38_pkgs
env:
- GCC_VER=5
- VARIANT=usan
- CLANG_VER=3.8
- ADDRESS_MODEL=64
- UBSAN_OPTIONS='print_stacktrace=1'
- PATH=$PWD/llvm-$LLVM_VERSION/bin:$PATH
addons: *ao_gcc5
# Clang/AddressSanitizer
- compiler: clang
env: GCC_VER=5 VARIANT=asan CLANG_VER=3.8 ADDRESS_MODEL=64
addons: *ao_clang38
env:
- GCC_VER=5
- VARIANT=asan
- CLANG_VER=3.8
- ADDRESS_MODEL=64
- PATH=$PWD/llvm-$LLVM_VERSION/bin:$PATH
addons: *ao_gcc5
cache:
directories:
- $BOOST_ROOT
- $VALGRIND_ROOT
- llvm-$LLVM_VERSION
- cmake
before_install:
- scripts/install-dependencies.sh

View File

@@ -37,8 +37,8 @@ elif [[ $(uname -s) == "Linux" ]]; then
num_proc_units=$(nproc)
# Physical cores
num_jobs=$(lscpu -p | grep -v '^#' | sort -u -t, -k 2,4 | wc -l)
if (("$num_proc_units" < "$num_jobs")); then
num_jobs=$num_proc_units
if ((${num_proc_units} < ${num_jobs})); then
num_jobs=$num_proc_units
fi
fi
@@ -82,6 +82,16 @@ function build_beast {
-j${num_jobs}
}
function build_beast_cmake {
mkdir -p build
pushd build > /dev/null
cmake -DCMAKE_BUILD_TYPE=${VARIANT^} ..
make -j${num_jobs}
mkdir -p ../bin/$VARIANT
find . -executable -type f -exec cp {} ../bin/$VARIANT/. \;
popd > /dev/null
}
function run_autobahn_test_suite {
# Run autobahn tests
wsecho=$(find bin -name "websocket-echo" | grep /$VARIANT/)
@@ -108,7 +118,11 @@ function run_autobahn_test_suite {
##################################### BUILD ####################################
build_beast
if [[ ${BUILD_SYSTEM:-} == cmake ]]; then
build_beast_cmake
else
build_beast
fi
##################################### TESTS ####################################

View File

@@ -12,11 +12,32 @@ do
test -x $( type -p ${g}-$GCC_VER )
ln -sv $(type -p ${g}-$GCC_VER) $HOME/bin/${g}
done
for c in clang clang++ llvm-symbolizer
do
test -x $( type -p ${c}-$CLANG_VER )
ln -sv $(type -p ${c}-$CLANG_VER) $HOME/bin/${c}
done
if [[ -n ${CLANG_VER:-} ]]; then
# There are cases where the directory exists, but the exe is not available.
# Use this workaround for now.
if [[ ! -x llvm-${LLVM_VERSION}/bin/llvm-config ]] && [[ -d llvm-${LLVM_VERSION} ]]; then
rm -fr llvm-${LLVM_VERSION}
fi
if [[ ! -d llvm-${LLVM_VERSION} ]]; then
mkdir llvm-${LLVM_VERSION}
LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-14.04.tar.xz"
wget -O - ${LLVM_URL} | tar -Jxvf - --strip 1 -C llvm-${LLVM_VERSION}
fi
llvm-${LLVM_VERSION}/bin/llvm-config --version;
export LLVM_CONFIG="llvm-${LLVM_VERSION}/bin/llvm-config";
fi
# There are cases where the directory exists, but the exe is not available.
# Use this workaround for now.
if [[ ! -x cmake/bin/cmake && -d cmake ]]; then
rm -fr cmake
fi
if [[ ! -d cmake && ${BUILD_SYSTEM:-} == cmake ]]; then
CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.2-Linux-x86_64.tar.gz"
mkdir cmake && wget --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
fi
# NOTE, changed from PWD -> HOME
export PATH=$HOME/bin:$PATH