1 # Travis CI configuration file
10 # Install autopoint on Ubuntu (needed for gettext)
11 # This is ignored on bionic for some reason (see below).
18 # More configurations are configured in the matrix section
37 - env: CONFIG=normal DIST=bionic
41 - env: CONFIG=normal DIST=bionic
45 - env: CONFIG=normal DIST=xenial
49 - env: CONFIG=normal DIST=xenial
59 - llvm-toolchain-trusty-6.0
60 - ubuntu-toolchain-r-test
70 - llvm-toolchain-trusty-8
71 - ubuntu-toolchain-r-test
81 - ubuntu-toolchain-r-test
85 - env: CONFIG=arm-cross
92 - gcc-4.8-arm-linux-gnueabihf
93 - libc6-dev-armhf-cross
102 - env: CONFIG=sanitize
108 - llvm-toolchain-trusty-8
109 - ubuntu-toolchain-r-test
114 # Required for -fsanitize=undefined
115 # see https://github.com/travis-ci/travis-ci/issues/9033
117 - env: CONFIG=coverage
131 # The apt addons section is ignored on bionic for some reason
132 - if [ "$DIST" = "bionic" ] ; then sudo apt-get install -y autopoint; fi
136 if [ "$CONFIG" = "coverage" ] ; then
138 pip install --user cpp-coveralls
140 git clone --depth=1 https://github.com/libexif/libexif-testsuite.git
143 ln -s "$TRAVIS_BUILD_DIR" src/libexif
147 # Failmalloc for improved test coverage
148 if [ ! -e "$HOME/failmalloc/lib/libfailmalloc.so.0" ] ; then
149 curl -fsSORL --retry 8 https://download.savannah.nongnu.org/releases/failmalloc/failmalloc-1.0.tar.gz
150 tar xaf failmalloc-1.0.tar.gz
152 sed -i -e 's/\(__malloc_initialize_hook\)/volatile \1/' failmalloc.c
153 ./configure --prefix="$HOME/failmalloc" --disable-dependency-tracking
157 cd "$TRAVIS_BUILD_DIR"
161 # Ensure brew gettext is in the PATH so autopoint is found on OS X
162 - PATH="$PATH:/usr/local/opt/gettext/bin" autoreconf -sivf
163 - if [ "$CONFIG" = "normal" ] ; then CFLAGS='-Wall -Wextra -O3'; fi
164 - if [ "$CONFIG" = "c90" ] ; then CFLAGS='-std=iso9899:1990 -D_XOPEN_SOURCE=500 -Wall -Wextra -O3'; fi
165 - if [ "$CONFIG" = "stackprotect" ] ; then CFLAGS='-g -O0 -fstack-protector-all'; fi
166 - if [ "$CONFIG" = "disable-nls" ] ; then CFLAGS='-Wall -Wextra -O3'; CONFIGURE_OPTS='--disable-nls'; fi
167 - if [ "$CONFIG" = "clang6" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=clang-6.0; fi
168 - if [ "$CONFIG" = "clang8" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=clang-8; fi
169 - if [ "$CONFIG" = "gcc8" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=gcc-8; fi
170 - if [ "$CONFIG" = "arm-cross" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=arm-linux-gnueabihf-gcc-4.8; CONFIGURE_OPTS='--host=arm-linux-gnueabihf'; fi
171 - if [ "$CONFIG" = "musl" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=musl-gcc; CONFIGURE_OPTS='--disable-shared'; fi
172 - 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
173 - if [ "$CONFIG" = "coverage" ] ; then cd "$HOME"/libexif-testsuite; CFLAGS=--coverage; CONFIGURE_OPTS="LDFLAGS=--coverage --with-failmalloc=$HOME/failmalloc/lib" ; fi
174 - ./configure --prefix="$HOME"/install --disable-dependency-tracking CFLAGS="$CFLAGS" $CONFIGURE_OPTS || { tail -300 config.log; false; }
177 # Skip tests when cross compiling.
178 - if [ "$CONFIG" != "arm-cross" ] ; then make V=1 check || { tail -300 test*/test-suite.log; false; }; fi
181 - if [ "$CONFIG" = "coverage" ] ; then cd "$TRAVIS_BUILD_DIR"; fi
184 - if [ "$CONFIG" = "coverage" ] ; then coveralls --build-root libexif --exclude test --exclude contrib --gcov-options '\-lp'; fi