summaryrefslogtreecommitdiff
path: root/.travis.yml
blob: a0a8c0313929d7818868889413c159c636a3eaeb (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
language: c
sudo: false
cache:
    directories:
        - $HOME/.cache/pip
        - $HOME/deps
matrix:
    include:
        - os: linux
          compiler: gcc
          env: BUILD_TYPE=normal
        - os: linux
          compiler: clang
          env: BUILD_TYPE=normal
        - os: linux
          compiler: gcc
          env: BUILD_TYPE=coverage
        - os: linux
          compiler: clang
          env: BUILD_TYPE=ubsan
        - os: linux
          compiler: clang
          env: BUILD_TYPE=asan
        - os: linux
          compiler: clang
          env: BUILD_TYPE=lsan
        - os: linux
          compiler: clang
          env: BUILD_TYPE=msan
        - os: osx
          compiler: gcc
          env: BUILD_TYPE=normal
        - os: osx
          compiler: clang
          env: BUILD_TYPE=normal

install:
    - pip install --user 'requests[security]'
    - pip install --user cpp-coveralls
    - |
        mkdir -p deps
        pushd deps
        export PREFIXDIR=`pwd`
        if [ ! -f "libtool-2.4.6.tar.xz" ]; then
             wget http://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.xz
        fi
        if [ ! -f "automake-1.15.tar.xz" ]; then
             wget http://ftp.gnu.org/gnu/automake/automake-1.15.tar.xz
        fi
        if [ ! -d "libtool-2.4.6" ]; then
             tar xf libtool-2.4.6.tar.xz
             pushd libtool-2.4.6/
             ./configure --prefix=$PREFIXDIR
             make && make install
             popd
             cp $PREFIXDIR/bin/libtool $PREFIXDIR/bin/glibtool
             cp $PREFIXDIR/bin/libtoolize $PREFIXDIR/bin/glibtoolize
        fi
        if [ ! -d "automake-1.15" ]; then
             tar xf automake-1.15.tar.xz
             pushd automake-1.15/
             ./configure --prefix=$PREFIXDIR
             make && make install
             popd
        fi
        export PATH="$PREFIXDIR/bin:$PATH"
        popd
before_script:
    - |
        if [ "$BUILD_TYPE" = "coverage" ]; then
             export CFLAGS="-fprofile-arcs -ftest-coverage"
             export LDFLAGS="-fprofile-arcs -ftest-coverage"
        fi
    - |
         if [ "$BUILD_TYPE" = "asan" ]; then
             export CFLAGS=-fsanitize=address
             export LDFLAGS=-fsanitize=address
         fi
    - |
         if [ "$BUILD_TYPE" = "lsan" ]; then
             export CFLAGS=-fsanitize=leak
             export LDFLAGS=-fsanitize=leak
         fi
    - |
         if [ "$BUILD_TYPE" = "msan" ]; then
             export CFLAGS=-fsanitize=memory
             export LDFLAGS=-fsanitize=memory
         fi
    - |
         if [ "$BUILD_TYPE" = "ubsan" ]; then
             export CFLAGS="-fsanitize=undefined -fno-sanitize-recover"
             export LDFLAGS="-fsanitize=undefined"
         fi
script:
    - ./autogen.sh && ./configure && make && make check
    - |
          if [ "$BUILD_TYPE" = "coverage" ]; then
              cpp-coveralls --gcov-options '\-lp'
          fi