language: c

compiler:
  - clang
  - gcc

sudo: false

addons:
  apt:
    packages:
    - asciidoc
    - xmlto
    - valgrind

script:
  - # ============ Build from config ===============
  - cp contrib/config.make .
  - make all-debug
  - make test
  - make test TEST_OPTS=valgrind
  - if [ $CC = clang ]; then make test-address-sanitizer; fi
  - make DESTDIR=/tmp/bare-destdir install install-doc
  - make DESTDIR=/tmp/bare-destdir uninstall
  - test ! -d /tmp/bare-destdir
  - make prefix=/tmp/bare-prefix install install-doc
  - make prefix=/tmp/bare-prefix uninstall
  - test ! -d /tmp/bare-prefix
  - make distclean
  - # ============ Build using autoconf ============
  - make dist
  - ./configure --prefix=/tmp/conf-prefix
  - make V=1 TEST_SHELL=bash all test install install-doc
  - make uninstall
  - test ! -d /tmp/conf-prefix
  - make clean
