Display the test log on a Travis test failure.
[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 matrix:
26   include:
27   - os: linux
28     addons:
29       apt:
30         sources:
31           - llvm-toolchain-trusty-6.0
32           - ubuntu-toolchain-r-test
33         packages:
34           - autopoint
35           - clang-6.0
36     compiler: clang
37     env:
38       - CONFIG=clang6
39   - os: linux
40     addons:
41       apt:
42         sources:
43           - ubuntu-toolchain-r-test
44         packages:
45           - autopoint
46           - g++-8
47     compiler: gcc
48     env:
49       - CONFIG=gcc8
50   - os: linux
51     addons:
52       apt:
53         sources:
54           - llvm-toolchain-trusty-6.0
55           - ubuntu-toolchain-r-test
56         packages:
57           - autopoint
58           - clang-6.0
59           - libtool
60     compiler: clang
61     # Required for -fsanitize=undefined
62     # see https://github.com/travis-ci/travis-ci/issues/9033
63     sudo: required
64     env:
65       - CONFIG=sanitize
66
67 script:
68   # Ensure brew gettext is in the PATH so autopoint is found on OS X
69   - PATH="$PATH:/usr/local/opt/gettext/bin" autoreconf -sivf
70   - if [ "$CONFIG" = "normal" ] ; then CFLAGS='-Wall -Wextra -O3'; fi
71   - if [ "$CONFIG" = "c90" ] ; then CFLAGS='-std=iso9899:1990 -D_XOPEN_SOURCE=500 -Wall -Wextra -O3'; fi
72   - if [ "$CONFIG" = "stackprotect" ] ; then CFLAGS='-g -O0 -fstack-protector-all'; fi
73   - if [ "$CONFIG" = "clang6" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=clang-6.0; fi
74   - if [ "$CONFIG" = "gcc8" ] ; then CFLAGS='-Wall -Wextra -O3'; export export CC=gcc-8; fi
75   - if [ "$CONFIG" = "sanitize" ] ; then CFLAGS='-g -Wall -Wextra -fsanitize=address -fsanitize=undefined'; export CC=clang-6.0; fi
76   - ./configure --prefix="${HOME}" CFLAGS="$CFLAGS" || { tail -300 config.log; false; }
77   - make
78   - make check || { tail -300 test/test-suite.log; false; }
79   - make install
80
81 compiler:
82   - clang
83   - gcc
84
85 os:
86   - linux
87   - osx