summaryrefslogtreecommitdiffstats
path: root/.travis.yml
blob: 922b165a52ef563b0db3d535de3c12bfee254444 (plain)
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
29
30
31
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
os:
    - linux
    - osx

sudo: false

language: c

compiler:
    - gcc
    - clang

matrix:
    include:
        - compiler: gcc
          env: COVERAGE="--disable-valgrind --enable-gcov"
          os: linux

addons:
    apt:
        packages:
            - valgrind
            - bison
            - automake

before_install:
    - echo "$TRAVIS_OS_NAME"
    - uname -s
    - brew update               || true;
      brew install flex         || true;
      brew install bison        || true;
    - rm src/{lexer,parser}.{c,h}
    - sed -i.bak '/^AM_INIT_AUTOMAKE(\[-Wno-portability 1\.14\])$/s/14/11/' modules/oniguruma/configure.ac

install:
    - bundle install --gemfile=docs/Gemfile
    - wget http://ftp.debian.org/debian/pool/main/b/bison/bison_3.0.2.dfsg-2_amd64.deb
    - ar p bison_3.0.2.dfsg-2_amd64.deb data.tar.xz | tar xJ
    - if [ -n "$COVERAGE" ]; then pip install --user cpp-coveralls; fi

before_script:
    # If this is OS X we'll get bison from brew, else we'll get bison
    # from the .deb unpacked above in the install section.
    - PATH=/usr/local/opt/bison/bin:$PWD/usr/bin:$PATH
    - echo SHELL=$SHELL
    - echo PATH=$PATH
    - which bison
    - bison --version
    - autoreconf -if
    - ./configure YACC="$(which bison) -y" $COVERAGE

script:
    # When using the bison from Debian we need to tell that bison where
    # to find its data.  Yay non-relocatable code.  Not.
    - echo PATH=$PATH
    - which bison
    - make BISON_PKGDATADIR=$PWD/usr/share/bison src/parser.c || make src/parser.c
    - make -j4
    - make check -j4

after_script:
    - |
        if [ -n "$COVERAGE" ]; then
            rm -rf src/.libs # don't care about coverage for libjq
            coveralls --gcov-options '\-lp' \
                -e src/lexer.c -e src/parser.c -e src/jv_dtoa.c
        fi

after_failure:
    - cat test-suite.log
    - cat tests/*.log

notifications:
    email: false