Run the libexif-testsuite tests in parallel now that they can be.
[platform/upstream/libexif.git] / .travis.yml
1 # Travis CI configuration file
2
3 sudo: false
4
5 language: c
6
7 git:
8   depth: 1
9
10 # Install autopoint on Ubuntu (needed for gettext)
11 addons:
12   apt:
13     packages:
14     - autopoint
15
16 env:
17   # More configurations are configured in the matrix section
18   matrix:
19     - CONFIG=normal
20     - CONFIG=c90
21     - CONFIG=stackprotect
22   global:
23     - MAKEFLAGS='-j 2'
24
25 compiler:
26   - clang
27   - gcc
28
29 os:
30   - linux
31   - osx
32
33 matrix:
34   include:
35   - os: linux
36     addons:
37       apt:
38         sources:
39           - llvm-toolchain-trusty-6.0
40           - ubuntu-toolchain-r-test
41         packages:
42           - autopoint
43           - clang-6.0
44     compiler: clang
45     env:
46       - CONFIG=clang6
47   - os: linux
48     addons:
49       apt:
50         sources:
51           - ubuntu-toolchain-r-test
52         packages:
53           - autopoint
54           - g++-8
55     compiler: gcc
56     env:
57       - CONFIG=gcc8
58   - os: linux
59     addons:
60       apt:
61         sources:
62           - llvm-toolchain-trusty-6.0
63           - ubuntu-toolchain-r-test
64         packages:
65           - autopoint
66           - clang-6.0
67           - libtool
68     compiler: clang
69     # Required for -fsanitize=undefined
70     # see https://github.com/travis-ci/travis-ci/issues/9033
71     sudo: required
72     env:
73       - CONFIG=sanitize
74   - os: linux
75     addons:
76       apt:
77         packages:
78           - autopoint
79           - libpopt-dev
80           - subversion
81     compiler: gcc
82     env:
83       - CONFIG=coverage
84
85 install:
86   - |
87     if [ "$CONFIG" = "coverage" ] ; then
88       set -e
89       pip install --user cpp-coveralls
90       cd "$HOME"
91       git clone --depth=1 https://github.com/libexif/libexif-testsuite.git
92       cd libexif-testsuite
93       mkdir src
94       ln -s "$TRAVIS_BUILD_DIR" src/libexif
95       ./build-config.sh
96       autoreconf -sivf
97       cd "$TRAVIS_BUILD_DIR"
98     fi
99
100 script:
101   # Ensure brew gettext is in the PATH so autopoint is found on OS X
102   - PATH="$PATH:/usr/local/opt/gettext/bin" autoreconf -sivf
103   - if [ "$CONFIG" = "normal" ] ; then CFLAGS='-Wall -Wextra -O3'; fi
104   - if [ "$CONFIG" = "c90" ] ; then CFLAGS='-std=iso9899:1990 -D_XOPEN_SOURCE=500 -Wall -Wextra -O3'; fi
105   - if [ "$CONFIG" = "stackprotect" ] ; then CFLAGS='-g -O0 -fstack-protector-all'; fi
106   - if [ "$CONFIG" = "clang6" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=clang-6.0; fi
107   - if [ "$CONFIG" = "gcc8" ] ; then CFLAGS='-Wall -Wextra -O3'; export export CC=gcc-8; fi
108   - if [ "$CONFIG" = "sanitize" ] ; then CFLAGS='-g -Wall -Wextra -fsanitize=address -fsanitize=undefined'; export CC=clang-6.0; fi
109   - if [ "$CONFIG" = "coverage" ] ; then cd "$HOME"/libexif-testsuite; CFLAGS=--coverage; LDFLAGS=--coverage; fi
110   - ./configure --prefix="${HOME}"/install CFLAGS="$CFLAGS" ${LDFLAGS:+LDFLAGS=$LDFLAGS} || { tail -300 config.log; false; }
111   - make
112   - make check || { tail -300 test*/test-suite.log; false; }
113   - make install
114   - if [ "$CONFIG" = "coverage" ] ; then cd "$TRAVIS_BUILD_DIR"; fi
115
116 after_success:
117   - if [ "$CONFIG" = "coverage" ] ; then coveralls --build-root libexif --exclude test --exclude contrib --gcov-options '\-lp'; fi