language: c
os:
    - linux
    - osx
compiler:
    - clang
notifications:
    email:
        on_success: change
        on_failure: change
    slack:
        rooms: cznic:xNJmvHU2xu2aGtN7Y2eqHKoD
        on_success: change
        on_failure: change
    webhooks:
        urls: https://webhooks.gitter.im/e/66485d8f591942052faa
        on_success: always
        on_failure: always
matrix:
    fast_finish: true
    allow_failures:
        - os: osx
env:
    global:
        - PKG_CONFIG_PATH="${HOME}/.local/lib/pkgconfig"
        - PATH="${HOME}/.local/bin:/usr/local/bin:${PATH}"
        - CFLAGS="-O2 -g -fno-omit-frame-pointer -DDEBUG"
        - LD_LIBRARY_PATH="${HOME}/.local/lib"
        - DYLD_LIBRARY_PATH="${HOME}/.local/lib"
        - MALLOC_CHECK_=3
        - MALLOC_PERTURB_=223
before_script:
    - ./scripts/bootstrap-depends.sh ${HOME}/.local
script:
    - make -j2 install check COVERAGE=1 PREFIX=${HOME}/.local
    - ./daemon/kresd -h
    - ./daemon/kresd -V
    - echo "quit()" | ./daemon/kresd -a 127.0.0.1#53535 .
    - make -j2 check-integration COVERAGE=1 PREFIX=${HOME}/.local
after_success:
    - test $TRAVIS_OS_NAME = linux && coveralls -i lib -i daemon -x ".c" --gcov-options '\-lp'
sudo: false
cache:
    directories:
    - ${HOME}/.local
    - ${HOME}/.cache/pip
before_cache:
    - rm -f ${HOME}/.local/sbin/kresd
    - rm -f ${HOME}/.local/lib/libkres.a
    - rm -rf ${HOME}/.local/include/libkres
    - rm -rf ${HOME}/.local/lib/kdns_modules
