1 # Travis CI configuration file
10 # Install autopoint on Ubuntu (needed for gettext)
17 # More configurations are configured in the matrix section
39 - llvm-toolchain-trusty-6.0
40 - ubuntu-toolchain-r-test
51 - ubuntu-toolchain-r-test
62 - llvm-toolchain-trusty-6.0
63 - ubuntu-toolchain-r-test
69 # Required for -fsanitize=undefined
70 # see https://github.com/travis-ci/travis-ci/issues/9033
90 if [ "$CONFIG" = "coverage" ] ; then
92 pip install --user cpp-coveralls
94 git clone --depth=1 https://github.com/libexif/libexif-testsuite.git
97 ln -s "$TRAVIS_BUILD_DIR" src/libexif
101 # Failmalloc for improved test coverage
102 if [ ! -e "$HOME/failmalloc/lib/libfailmalloc.so.0" ] ; then
103 curl -fsSORL https://download.savannah.nongnu.org/releases/failmalloc/failmalloc-1.0.tar.gz
104 tar xaf failmalloc-1.0.tar.gz
106 sed -i -e 's/\(__malloc_initialize_hook\)/volatile \1/' failmalloc.c
107 ./configure --prefix="$HOME/failmalloc"
111 cd "$TRAVIS_BUILD_DIR"
115 # Ensure brew gettext is in the PATH so autopoint is found on OS X
116 - PATH="$PATH:/usr/local/opt/gettext/bin" autoreconf -sivf
117 - if [ "$CONFIG" = "normal" ] ; then CFLAGS='-Wall -Wextra -O3'; fi
118 - if [ "$CONFIG" = "c90" ] ; then CFLAGS='-std=iso9899:1990 -D_XOPEN_SOURCE=500 -Wall -Wextra -O3'; fi
119 - if [ "$CONFIG" = "stackprotect" ] ; then CFLAGS='-g -O0 -fstack-protector-all'; fi
120 - if [ "$CONFIG" = "clang6" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=clang-6.0; fi
121 - if [ "$CONFIG" = "gcc8" ] ; then CFLAGS='-Wall -Wextra -O3'; export export CC=gcc-8; fi
122 - if [ "$CONFIG" = "sanitize" ] ; then CFLAGS='-g -Wall -Wextra -fsanitize=address -fsanitize=undefined'; export CC=clang-6.0; fi
123 - if [ "$CONFIG" = "coverage" ] ; then cd "$HOME"/libexif-testsuite; CFLAGS=--coverage; CONFIGURE_OPTS="LDFLAGS=--coverage --with-failmalloc=$HOME/failmalloc/lib" ; fi
124 - ./configure --prefix="${HOME}"/install CFLAGS="$CFLAGS" $CONFIGURE_OPTS || { tail -300 config.log; false; }
126 - make V=1 check || { tail -300 test*/test-suite.log; false; }
128 - if [ "$CONFIG" = "coverage" ] ; then cd "$TRAVIS_BUILD_DIR"; fi
131 - if [ "$CONFIG" = "coverage" ] ; then coveralls --build-root libexif --exclude test --exclude contrib --gcov-options '\-lp'; fi