sudo: false language: c addons: apt: # Define the required packages without libjansson so we can do a # build without libjansson. packages-without-jansson: &packages-without-jansson - libpcre3 - libpcre3-dbg - libpcre3-dev - build-essential - autoconf - automake - libtool - libpcap-dev - libnet1-dev - libyaml-0-2 - libyaml-dev - zlib1g - zlib1g-dev - libcap-ng-dev - libcap-ng0 - make - libmagic-dev - libnetfilter-queue-dev - libnetfilter-queue1 - libnfnetlink-dev - libnfnetlink0 - libhiredis-dev - libjansson-dev - libevent-dev - libevent-pthreads-2.0-5 # Now define the default set of packages which is those above, and # libjansson. packages: &packages - *packages-without-jansson - libjansson-dev # Define the default CFLAGS used by all builds as a YAML anchor. default-cflags: &default-cflags CFLAGS="-Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-function" matrix: include: # Linux, gcc, coccinelle. - os: linux compiler: gcc env: - NAME="linux,gcc,cocci" - *default-cflags addons: apt: sources: - sourceline: ppa:npalix/coccinelle packages: - *packages - coccinelle # Linux, gcc, Rust (latest stable). - os: linux compiler: gcc env: - NAME="linux,gcc,rust" - *default-cflags - ENABLE_RUST="yes" - ARGS="--enable-rust" # Linux, gcc, Rust (1.7.0 - oldest supported). - os: linux compiler: gcc env: - NAME="linux,gcc,rust-1.7.0" - *default-cflags - ENABLE_RUST="yes" - RUST_VERSION="1.7.0" - ARGS="--enable-rust" # Linux, gcc, -DNDEBUG. - os: linux compiler: gcc env: - NAME="linux,gcc,ndebug" - *default-cflags - EXTRA_CFLAGS="-DNDEBUG" # Linux, clang. For this build we'll also enable -Wshadow. - os: linux compiler: clang env: - NAME="linux,clang" - *default-cflags - EXTRA_CFLAGS="-Wshadow" # Linux, gcc, profiling. - os: linux compiler: gcc env: - NAME="linux,gcc,profiling" - *default-cflags - ARGS="--enable-profiling" # Linux, gcc, debug. - os: linux compiler: gcc env: - NAME="linux,gcc,debug" - *default-cflags - ARGS="--enable-debug" - ENABLE_DEBUG="yes" # Linux, gcc, no jansson. - os: linux compiler: gcc env: - NAME="linux,gcc,no-json" - *default-cflags addons: apt: packages: - *packages-without-jansson # OSX 10.12, XCode 8.1 - os: osx compiler: gcc osx_image: xcode8.1 sudo: true env: - NAME="osx,gcc" - *default-cflags script: - sh ./autogen.sh - | if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CFLAGS="${CFLAGS} ${EXTRA_CFLAGS}" ./configure --enable-nfqueue --enable-unittests --enable-hiredis ${ARGS} fi - | if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export CFLAGS="${CFLAGS} ${EXTRA_CFLAGS}" ./configure --enable-unittests --enable-hiredis --enable-ipfw \ --enable-lua --with-libpcre-includes=/usr/local/include \ --with-libpcre-includes=/usr/local/include \ --with-libpcre-libraries=/usr/local/lib \ --with-libnss-includes=/usr/local/opt/nss/include/nss \ --with-libnss-libraries=/usr/local/opt/nss/lib \ --with-libnspr-includes=/usr/local/opt/nspr/include/nspr \ --with-libnspr-libraries=/usr/local/opt/nspr/lib fi # With debug enabled too much output is generated for Travis, so # redirect stderr to a file. - | # Linux container builds have 2 cores, make use of them. if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then j="-j 2" fi if [[ "$ENABLE_DEBUG" == "yes" ]]; then make ${j} check 2> stderr.log else make ${j} check fi before_install: - export PATH=$HOME/.cargo/bin:$PATH - | if [[ "$ENABLE_RUST" == "yes" ]]; then curl https://sh.rustup.rs -sSf | sh -s -- -y if [[ "$RUST_VERSION" != "" ]]; then rustup override set $RUST_VERSION fi rustc --version fi - | if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update # Unlink and install each dependency to avoid errors where a # formula might already be installed but is not the current # version. packages="" packages="$packages pkg-config" packages="$packages libmagic" packages="$packages libyaml" packages="$packages nss" packages="$packages nspr" packages="$packages jansson" packages="$packages libnet" packages="$packages lua" packages="$packages pcre" packages="$packages hiredis" for package in $packages; do if brew ls $package --versions > /dev/null; then brew unlink $package fi done # Now install. brew install $packages # Now relink, becuase if a newer version of a package wasn't # installed above, it will remain unlinked. brew link $packages fi - ./qa/travis-libhtp.sh