1 # Travis CI configuration file
8 # Set to 10 instead of 1 to avoid problems when the most recent commits have [skip ci]
11 # Install autopoint on Ubuntu (needed for gettext)
12 # This is ignored on bionic for some reason (see below).
19 # More configurations are configured in the matrix section
38 - env: CONFIG=normal DIST=bionic
42 - env: CONFIG=normal DIST=bionic
46 - env: CONFIG=normal DIST=xenial
50 - env: CONFIG=normal DIST=xenial
60 - llvm-toolchain-trusty-6.0
61 - ubuntu-toolchain-r-test
71 - llvm-toolchain-trusty-8
72 - ubuntu-toolchain-r-test
82 - ubuntu-toolchain-r-test
86 - env: CONFIG=arm-cross
93 - gcc-4.8-arm-linux-gnueabihf
94 - libc6-dev-armhf-cross
103 - env: CONFIG=sanitize
109 - llvm-toolchain-trusty-8
110 - ubuntu-toolchain-r-test
115 # Required for -fsanitize=undefined
116 # see https://github.com/travis-ci/travis-ci/issues/9033
118 - env: CONFIG=coverage
132 # The apt addons section is ignored on bionic for some reason
133 - if [ "$DIST" = "bionic" ] ; then sudo apt-get install -y autopoint; fi
137 if [ "$CONFIG" = "coverage" ] ; then
139 pip install --user cpp-coveralls
141 git clone --depth=1 https://github.com/libexif/libexif-testsuite.git
144 ln -s "$TRAVIS_BUILD_DIR" src/libexif
148 # Failmalloc for improved test coverage
149 if [ ! -e "$HOME/failmalloc/lib/libfailmalloc.so.0" ] ; then
150 curl -fsSORL --retry 8 https://download.savannah.nongnu.org/releases/failmalloc/failmalloc-1.0.tar.gz
151 tar xaf failmalloc-1.0.tar.gz
153 sed -i -e 's/\(__malloc_initialize_hook\)/volatile \1/' failmalloc.c
154 ./configure --prefix="$HOME/failmalloc" --disable-dependency-tracking
158 cd "$TRAVIS_BUILD_DIR"
162 # Ensure brew gettext is in the PATH so autopoint is found on OS X
163 - PATH="$PATH:/usr/local/opt/gettext/bin" autoreconf -sivf
164 - if [ "$CONFIG" = "normal" ] ; then CFLAGS='-Wall -Wextra -O3'; fi
165 - if [ "$CONFIG" = "c90" ] ; then CFLAGS='-std=iso9899:1990 -D_XOPEN_SOURCE=500 -Wall -Wextra -O3'; fi
166 - if [ "$CONFIG" = "stackprotect" ] ; then CFLAGS='-g -O0 -fstack-protector-all'; fi
167 - if [ "$CONFIG" = "disable-nls" ] ; then CFLAGS='-Wall -Wextra -O3'; CONFIGURE_OPTS='--disable-nls'; fi
168 - if [ "$CONFIG" = "clang6" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=clang-6.0; fi
169 - if [ "$CONFIG" = "clang8" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=clang-8; fi
170 - if [ "$CONFIG" = "gcc8" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=gcc-8; fi
171 - if [ "$CONFIG" = "arm-cross" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=arm-linux-gnueabihf-gcc-4.8; CONFIGURE_OPTS='--host=arm-linux-gnueabihf'; fi
172 - if [ "$CONFIG" = "musl" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=musl-gcc; CONFIGURE_OPTS='--disable-shared'; fi
173 - if [ "$CONFIG" = "sanitize" ] ; then CFLAGS='-g -Wall -Wextra -fsanitize=address -fsanitize=undefined -fsanitize-address-use-after-scope'; export CC=clang-8; export ASAN_OPTIONS=strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:detect_leaks=1; fi
174 - if [ "$CONFIG" = "coverage" ] ; then cd "$HOME"/libexif-testsuite; CFLAGS=--coverage; CONFIGURE_OPTS="LDFLAGS=--coverage --with-failmalloc=$HOME/failmalloc/lib" ; fi
175 - ./configure --prefix="$HOME"/install --disable-dependency-tracking CFLAGS="$CFLAGS" $CONFIGURE_OPTS || { tail -300 config.log; false; }
178 # Skip tests when cross compiling.
179 - if [ "$CONFIG" != "arm-cross" ] ; then make V=1 check || { tail -300 test*/test-suite.log; false; }; fi
182 - if [ "$CONFIG" = "coverage" ] ; then cd "$TRAVIS_BUILD_DIR"; fi
185 - if [ "$CONFIG" = "coverage" ] ; then coveralls --build-root libexif --exclude test --exclude contrib --gcov-options '\-lp'; fi