language: cpp
os:
- linux
- osx
compiler:
- gcc
- clang
env:
- DEBUG="debug" COVERAGE="coverage"
- DEBUG="nodebug" COVERAGE="nocoverage"
- LINKING="static"
before_install:
- eval "${MATRIX_EVAL}"
- export LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/lib"
- export PATH=$PATH:/usr/local/lib
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
- export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install info install-info; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo pip install codecov; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo pip install gcovr; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install cppcheck; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export CFLAGS='-mtune=generic'; fi
- curl https://s3.amazonaws.com/libhttpserver/libmicrohttpd_releases/libmicrohttpd-0.9.59.tar.gz -o libmicrohttpd-0.9.59.tar.gz
- tar -xvzf libmicrohttpd-0.9.59.tar.gz
- cd libmicrohttpd-0.9.59
- if [[ "$ARM_ARCH_DIR" != "" ]]; then ./configure --build `./config.guess` --host $ARM_ARCH_DIR --disable-examples; else ./configure --disable-examples; fi
- make
- sudo make install
- cd ..
- if [ "$BUILD_TYPE" = "asan" ]; then export CFLAGS='-fsanitize=address'; export CXXLAGS='-fsanitize=address'; export LDFLAGS='-fsanitize=address'; fi
- if [ "$BUILD_TYPE" = "msan" ]; then export CFLAGS='-fsanitize=memory'; export CXXLAGS='-fsanitize=memory'; export LDFLAGS='-fsanitize=memory'; fi
- if [ "$BUILD_TYPE" = "lsan" ]; then export CFLAGS='-fsanitize=leak'; export CXXLAGS='-fsanitize=leak'; export LDFLAGS='-fsanitize=leak'; fi
- if [ "$BUILD_TYPE" = "tsan" ]; then export CFLAGS='-fsanitize=thread'; export CXXLAGS='-fsanitize=thread'; export LDFLAGS='-fsanitize=thread'; fi
- if [ "$BUILD_TYPE" = "ubsan" ]; then export export CFLAGS='-fsanitize=undefined'; export CXXLAGS='-fsanitize=undefined'; export LDFLAGS='-fsanitize=undefined'; fi
install:
- if [[ "$CROSS_COMPILE" == 1 ]] ; then
if [[ "$ARM_ARCH_DIR" == "aarch64-linux-gnu" ]] ; then
mkdir $HOME/linker_bin ;
ln -s /usr/bin/aarch64-linux-gnu-ld $HOME/linker_bin/ld ;
LD=$HOME/linker_bin/ld ;
echo "SETTING GNU LINKER DIR" ;
ls -al $HOME/linker_bin/ld ;
fi
fi
- ./bootstrap
- mkdir build
- cd build
- if [ "$LINKING" = "static" ]; then
../configure --enable-static --disable-fastopen;
elif [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ]; then
../configure --enable-debug --enable-coverage --disable-shared --disable-fastopen;
elif [ "$DEBUG" = "debug" ]; then
../configure --enable-debug --disable-shared --disable-fastopen;
elif [ "$CROSS_COMPILE" = "1" ] && [ "$ARM_ARCH_DIR" = "aarch64-linux-gnu" ]; then
../configure --disable-fastopen --build `../config.guess` --host aarch64-linux-gnu CC="gcc -B$HOME/linker_bin" CXX="g++ -B$HOME/linker_bin";
elif [ "$CROSS_COMPILE" = "1" ] && [ "$ARM_ARCH_DIR" = "arm-linux-gnueabi" ]; then
../configure --disable-fastopen --build `../config.guess` --host arm-linux-gnueabi;
elif [ "$VALGRIND" = "valgrind" ]; then
../configure --enable-debug --disable-fastopen --disable-valgrind-helgrind --disable-valgrind-drd --disable-valgrind-sgcheck;
else
../configure --disable-fastopen;
fi
- if [ "$CROSS_COMPILE" = "1" ] && [ "$ARM_ARCH_DIR" = "aarch64-linux-gnu" ]; then sed -i 's+/usr/bin/ld+$HOME/linker_bin/ld+g' libtool; fi
- if [ "$CROSS_COMPILE" = "1" ] && [ "$ARM_ARCH_DIR" = "aarch64-linux-gnu" ]; then sed -i 's+/usr/bin/ld+$HOME/linker_bin/ld+g' Makefile; fi
- make
- make check TESTS=
script:
- if [[ "$CROSS_COMPILE" == 1 ]]; then
cd test ;
if [[ "$ARM_ARCH_DIR" == "aarch64-linux-gnu" ]]; then
file ./.libs/basic;
file ./.libs/http_utils;
file ./.libs/threaded;
qemu-aarch64 -L /usr/aarch64-linux-gnu/ ./.libs/basic ;
qemu-aarch64 -L /usr/aarch64-linux-gnu/ ./.libs/http_utils ;
qemu-aarch64 -L /usr/aarch64-linux-gnu/ ./.libs/threaded ;
else
file ./.libs/basic;
file ./.libs/http_utils;
file ./.libs/threaded;
qemu-arm -L /usr/arm-linux-gnueabi/ ./.libs/basic ;
qemu-arm -L /usr/arm-linux-gnueabi/ ./.libs/http_utils ;
qemu-arm -L /usr/arm-linux-gnueabi/ ./.libs/threaded ;
fi
fi
- make check
- cat test/test-suite.log
- if [ "$VALGRIND" = "valgrind" ]; then make check-valgrind; fi;
- if [ "$VALGRIND" = "valgrind" ]; then cat test/test-suite-memcheck.log; fi;
- ls -l /usr/local/lib/
- ls -l /usr/lib/
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd ../src/; cppcheck --error-exitcode=1 .; cd ../build; fi
- |
if [ "$PERFORMANCE" = "select" ]; then
cd examples
./benchmark_select 8080 $(nproc) &
sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext
fi
- |
if [ "$PERFORMANCE" = "nodelay" ]; then
cd examples
./benchmark_nodelay 8080 $(nproc) &
sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext
fi
- |
if [ "$PERFORMANCE" = "threads" ]; then
cd examples
./benchmark_threads 8080 &
sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext
fi
after_success:
- if [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then bash <(curl -s https://codecov.io/bash); fi
matrix:
exclude:
- compiler: clang
env: DEBUG="debug" COVERAGE="coverage"
- compiler: clang
env: LINKING='static'
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
env: MATRIX_EVAL="BUILD_TYPE=asan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
env: MATRIX_EVAL="BUILD_TYPE=msan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
env: MATRIX_EVAL="BUILD_TYPE=lsan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
env: MATRIX_EVAL="BUILD_TYPE=tsan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
env: MATRIX_EVAL="BUILD_TYPE=ubsan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env:
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
env:
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-8
env:
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- valgrind
- valgrind-dbg
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && VALGRIND=valgrind"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- apache2-utils
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && PERFORMANCE=select"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- apache2-utils
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && PERFORMANCE=nodelay"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- apache2-utils
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && PERFORMANCE=threads"
#- os: osx
# osx_image: xcode8
# env:
# - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
#- os: osx
# osx_image: xcode8
# env:
# - MATRIX_EVAL="brew install gcc5 && CC=gcc-5 && CXX=g++-5"
#- os: osx
# osx_image: xcode8
# env:
# - MATRIX_EVAL="brew install gcc6 && CC=gcc-6 && CXX=g++-6"
#- os: osx
# osx_image: xcode8
# env:
# - MATRIX_EVAL="brew install gcc && CC=gcc-7 && CXX=g++-7"
# works on Precise and Trusty
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.6
packages:
- clang-3.6
env:
- MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6"
# works on Precise and Trusty
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.7
packages:
- clang-3.7
env:
- MATRIX_EVAL="CC=clang-3.7 && CXX=clang++-3.7"
# works on Precise and Trusty
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
env:
- MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
# works on Trusty
- os: linux
addons:
apt:
sources:
- llvm-toolchain-trusty-3.9
packages:
- clang-3.9
env:
- MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
# works on Trusty
- os: linux
addons:
apt:
packages:
- clang-4.0
env:
- MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"
# works on Trusty
- os: linux
addons:
apt:
packages:
- clang-5.0
env:
- MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
- os: linux
addons:
apt:
packages:
- clang-6.0
env:
- MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0"
- os: linux
addons:
apt:
sources:
- llvm-toolchain-xenial-7
- ubuntu-toolchain-r-test
packages:
- clang-7
env:
- MATRIX_EVAL="CC=clang-7 && CXX=clang++-7"
- os: linux
addons:
apt:
sources:
- llvm-toolchain-xenial-8
- ubuntu-toolchain-r-test
packages:
- clang-8
env:
- MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
- os: linux
compiler: clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- clang-3.9
- g++-arm-linux-gnueabi
- g++-multilib
- gcc-multilib
- qemu
- qemu-system-arm
env: MATRIX_EVAL="CROSS_COMPILE=1 && ARM_ARCH_DIR=arm-linux-gnueabi && CC=arm-linux-gnueabi-gcc"
- os: linux
compiler: clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- clang-3.9
- g++-4.8-aarch64-linux-gnu
- gcc-4.8-aarch64-linux-gnu
- g++-4.8-multilib
- gcc-4.8-multilib
- qemu
- qemu-system-arm
env: MATRIX_EVAL="CROSS_COMPILE=1 && ARM_LD_PATH=$HOME/linker_bin && ARM_ARCH_DIR=aarch64-linux-gnu"
allow_failures:
- env: MATRIX_EVAL="CROSS_COMPILE=1 && ARM_ARCH_DIR=arm-linux-gnueabi && CC=arm-linux-gnueabi-gcc"
- env: MATRIX_EVAL="CROSS_COMPILE=1 && ARM_LD_PATH=$HOME/linker_bin && ARM_ARCH_DIR=aarch64-linux-gnu"