1 # Travis CI configuration file
10 # Install autopoint on Ubuntu (needed for gettext)
17 # More configurations are configured in the matrix section
41 - llvm-toolchain-trusty-6.0
42 - ubuntu-toolchain-r-test
52 - ubuntu-toolchain-r-test
56 - env: CONFIG=arm-cross
63 - gcc-4.8-arm-linux-gnueabihf
64 - libc6-dev-armhf-cross
73 - env: CONFIG=sanitize
79 - llvm-toolchain-trusty-6.0
80 - ubuntu-toolchain-r-test
85 # Required for -fsanitize=undefined
86 # see https://github.com/travis-ci/travis-ci/issues/9033
88 - env: CONFIG=coverage
103 if [ "$CONFIG" = "coverage" ] ; then
105 pip install --user cpp-coveralls
107 git clone --depth=1 https://github.com/libexif/libexif-testsuite.git
110 ln -s "$TRAVIS_BUILD_DIR" src/libexif
114 # Failmalloc for improved test coverage
115 if [ ! -e "$HOME/failmalloc/lib/libfailmalloc.so.0" ] ; then
116 curl -fsSORL https://download.savannah.nongnu.org/releases/failmalloc/failmalloc-1.0.tar.gz
117 tar xaf failmalloc-1.0.tar.gz
119 sed -i -e 's/\(__malloc_initialize_hook\)/volatile \1/' failmalloc.c
120 ./configure --prefix="$HOME/failmalloc"
124 cd "$TRAVIS_BUILD_DIR"
128 # Ensure brew gettext is in the PATH so autopoint is found on OS X
129 - PATH="$PATH:/usr/local/opt/gettext/bin" autoreconf -sivf
130 - if [ "$CONFIG" = "normal" ] ; then CFLAGS='-Wall -Wextra -O3'; fi
131 - if [ "$CONFIG" = "c90" ] ; then CFLAGS='-std=iso9899:1990 -D_XOPEN_SOURCE=500 -Wall -Wextra -O3'; fi
132 - if [ "$CONFIG" = "stackprotect" ] ; then CFLAGS='-g -O0 -fstack-protector-all'; fi
133 - if [ "$CONFIG" = "clang6" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=clang-6.0; fi
134 - if [ "$CONFIG" = "gcc8" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=gcc-8; fi
135 - if [ "$CONFIG" = "arm-cross" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=arm-linux-gnueabihf-gcc-4.8; CONFIGURE_OPTS='--host=arm-linux-gnueabihf'; fi
136 - if [ "$CONFIG" = "musl" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=musl-gcc; CONFIGURE_OPTS='--disable-shared'; fi
137 - if [ "$CONFIG" = "sanitize" ] ; then CFLAGS='-g -Wall -Wextra -fsanitize=address -fsanitize=undefined'; export CC=clang-6.0; fi
138 - if [ "$CONFIG" = "coverage" ] ; then cd "$HOME"/libexif-testsuite; CFLAGS=--coverage; CONFIGURE_OPTS="LDFLAGS=--coverage --with-failmalloc=$HOME/failmalloc/lib" ; fi
139 - ./configure --prefix="${HOME}"/install CFLAGS="$CFLAGS" $CONFIGURE_OPTS || { tail -300 config.log; false; }
142 # Skip tests when cross compiling.
143 - if [ "$CONFIG" != "arm-cross" ] ; then make V=1 check || { tail -300 test*/test-suite.log; false; }; fi
146 - if [ "$CONFIG" = "coverage" ] ; then cd "$TRAVIS_BUILD_DIR"; fi
149 - if [ "$CONFIG" = "coverage" ] ; then coveralls --build-root libexif --exclude test --exclude contrib --gcov-options '\-lp'; fi