.travis.yml 2.54 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
# travis configuration file
# Copyright 2018 Ilya Shipitsin <chipitsine@gmail.com>
#                Nicolas Mora <mail@babelouest.org>
sudo: required

language: c

addons:
  apt:
    packages: [ autoconf, automake, libtool, libsqlite3-dev, libmysqlclient-dev, libpq-dev, check, libsubunit-dev, cppcheck ]

matrix:
  include:
    - os: linux
      compiler: gcc
    - os: linux
      compiler: clang
    - env: LABEL=cppcheck
      os: linux
      script:
        - cppcheck --force --enable=warning,missingInclude --error-exitcode=1 . >build.log 2>&1 || (cat build.log && exit 1)
install:
- wget https://github.com/akheron/jansson/archive/v2.11.tar.gz -O jansson-2.11.tar.gz
- tar xzf jansson-2.11.tar.gz
- pushd jansson-2.11 && autoreconf -i && ./configure && make && sudo make install && popd
- rm -rf jansson-2.11

script:
29 30
  - mkdir build && cd build
  - cmake -DWITH_JOURNALD=off -DBUILD_HOEL_TESTING=on ..
31
  - make
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
  - sqlite3 /tmp/test.db < ../test/test.sql
  - make test package
  - sudo make install
  - rm -rf * && cmake -DWITH_JOURNALD=OFF -DWITH_SQLITE3=off -DWITH_MARIADB=off -DWITH_PGSQL=on ..
  - make package
  - rm -rf * && cmake -DWITH_JOURNALD=OFF -DWITH_SQLITE3=off -DWITH_MARIADB=on -DWITH_PGSQL=off ..
  - make package
  - rm -rf * && cmake -DWITH_JOURNALD=OFF -DWITH_SQLITE3=off -DWITH_MARIADB=on -DWITH_PGSQL=on ..
  - make package
  - rm -rf * && cmake -DWITH_JOURNALD=OFF -DWITH_SQLITE3=on -DWITH_MARIADB=off -DWITH_PGSQL=off ..
  - make package
  - rm -rf * && cmake -DWITH_JOURNALD=OFF -DWITH_SQLITE3=on -DWITH_MARIADB=off -DWITH_PGSQL=on ..
  - make package
  - rm -rf * && cmake -DWITH_JOURNALD=OFF -DWITH_SQLITE3=on -DWITH_MARIADB=on -DWITH_PGSQL=off ..
  - make package
  - rm -rf * && cmake -DWITH_JOURNALD=OFF -DWITH_SQLITE3=on -DWITH_MARIADB=on -DWITH_PGSQL=on ..
  - make package
  - rm -rf *
  - if $(cmake -DWITH_JOURNALD=OFF -DWITH_SQLITE3=off -DWITH_MARIADB=off -DWITH_PGSQL=off .. 1>/dev/null 2&>1); then echo "Build with no DB fail" && exit 1; else echo "Build with no DB success"; fi
  - cd ../
  - make clean debug
  - make clean debug DISABLE_SQLITE=1 DISABLE_MARIADB=1
  - make clean debug DISABLE_SQLITE=1 DISABLE_POSTGRESQL=1
  - make clean debug DISABLE_SQLITE=1
  - make clean debug DISABLE_MARIADB=1 DISABLE_POSTGRESQL=1
  - make clean debug DISABLE_MARIADB=1
  - make clean debug DISABLE_POSTGRESQL=1
  - if $(make clean debug DISABLE_SQLITE=1 DISABLE_MARIADB=1 DISABLE_POSTGRESQL=1 1>/dev/null 2&>1); then echo "Build with no DB fail" && exit 1; else echo "Build with no DB success"; fi
60
  - sqlite3 /tmp/test.db < test/test.sql
61
  - make clean check