+# Fix Travis write errors on Clang builds. These write errors occurred after
+# a Travis update to new Trusty images on Dec. 12th 2017. The reason for these
+# write errors is unknown. Using the deprecated builds did not fix the problem.
+# Setting 'filter_secrets: false' as suggested here
+# https://github.com/travis-ci/travis-ci/issues/4704#issuecomment-321777557
+# fixes the problem.
+filter_secrets: false
+
language: cpp
-cache: apt
-compiler:
- - gcc
- - clang
+cache:
+ - apt
+ - ccache
+
+sudo: false
+dist: trusty
+
env:
- - TRAVIS_CVC4=yes TRAVIS_CVC4_CONFIG='production --enable-language-bindings=java,c'
- - TRAVIS_CVC4=yes TRAVIS_CVC4_CONFIG='debug --enable-language-bindings=java,c'
- - TRAVIS_CVC4=yes TRAVIS_CVC4_DISTCHECK=yes
- - TRAVIS_LFSC=yes
- - TRAVIS_LFSC=yes TRAVIS_LFSC_DISTCHECK=yes
+ global:
+ - CCACHE_COMPRESS=1
+addons:
+ apt:
+ sources:
+ - ubuntu-toolchain-r-test
+ packages: &common_deps
+ - antlr3
+ - cmake
+ - cxxtest
+ - junit4
+ - libantlr3c-dev
+ - libcln-dev
+ - libgmp-dev
+ - libhamcrest-java
+ - openjdk-7-jdk
+ - swig3.0
before_install:
-# dhart/ppa is for cxxtest package, which doesn't appear officially until quantal
- - travis_retry sudo apt-add-repository -y ppa:dhart/ppa
- - travis_retry sudo apt-get update -qq
- - travis_retry sudo apt-get install -qq libgmp-dev antlr3 libantlr3c-dev libboost-dev libboost-thread-dev swig2.0 libcln-dev cxxtest openjdk-7-jdk
+ - eval "${MATRIX_EVAL}"
+ # Clang does not play nice with ccache (at least the versions offered by
+ # Travis), use a workaround:
+ # https://github.com/travis-ci/travis-ci/issues/5383#issuecomment-224630584
+ - |
+ if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$CXX" == "clang++" ]; then
+ export CFLAGS="-Qunused-arguments"
+ export CXXFLAGS="-Qunused-arguments"
+ sudo ln -s $(which ccache) /usr/lib/ccache/clang
+ sudo ln -s $(which ccache) /usr/lib/ccache/clang++
+ fi
before_script:
- - export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
- - export PATH=$PATH:$JAVA_HOME/bin
- - export JAVA_CPPFLAGS=-I$JAVA_HOME/include
- - ./autogen.sh
+ export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
script:
- - normal="$(echo -e '\033[0m')" red="$normal$(echo -e '\033[01;31m')" green="$normal$(echo -e '\033[01;32m')"
- - if [ -n "$TRAVIS_CVC4" ]; then
- if [ -n "$TRAVIS_CVC4_DISTCHECK" ]; then
- (contrib/new-theory test_newtheory || (echo; echo "${red}NEWTHEORY FAILED${normal}"; echo; exit 1)) &&
- (grep -q '^THEORIES *=.* test_newtheory' src/Makefile.am || (echo; echo "${red}NEWTHEORY FAILED${normal}"; echo; exit 1)) &&
- (contrib/new-theory --alternate test_newtheory test_newalttheory || (echo; echo "${red}NEWTHEORY-ALTERNATE FAILED${normal}"; echo; exit 1)) &&
- (grep -q '^THEORIES *=.* test_newalttheory' src/Makefile.am || (echo; echo "${red}NEWTHEORY-ALTERNATE FAILED${normal}"; echo; exit 1));
- fi;
- echo "CVC4 config - $TRAVIS_CVC4_CONFIG" &&
- (./configure --enable-unit-testing --enable-proof --with-portfolio $TRAVIS_CVC4_CONFIG || (echo; cat builds/config.log; echo; echo "${red}CONFIGURE FAILED${normal}"; exit 1)) &&
- if [ -n "$TRAVIS_CVC4_DISTCHECK" ]; then
- make -j2 distcheck CVC4_REGRESSION_ARGS='--no-early-exit' || (echo; echo "${red}DISTCHECK (WITH NEWTHEORY TESTS) FAILED${normal}"; echo; exit 1);
- else
- (make -j2 check CVC4_REGRESSION_ARGS='--no-early-exit' || (echo; echo "${red}BUILD/TEST FAILED${normal}"; echo; exit 1)) &&
- (make check BINARY=pcvc4 CVC4_REGRESSION_ARGS='--fallback-sequential --no-early-exit' RUN_REGRESSION_ARGS= || (echo; echo "${red}PORTFOLIO TEST FAILED${normal}"; echo; exit 1)) &&
- (make -j2 examples || (echo; echo "${red}COULD NOT BUILD EXAMPLES${normal}"; echo; exit 1));
- fi;
- elif [ -n "$TRAVIS_LFSC" ]; then
- cd proofs/lfsc_checker &&
- (./configure || (echo; cat builds/config.log; echo; echo "${red}CONFIGURE FAILED${normal}"; exit 1)) &&
- if [ -n "$TRAVIS_LFSC_DISTCHECK" ]; then
- make -j2 distcheck || (echo; echo "${red}LFSC DISTCHECK FAILED${normal}"; echo; exit 1);
- else
- make -j2 || (echo; echo "${red}LFSC BUILD FAILED${normal}"; echo; exit 1);
- fi;
- else
- echo "${red}Unknown Travis-CI configuration${normal}";
+ - ccache -M 1G
+ - ccache -z
+ - ${CC} --version
+ - ${CXX} --version
+ - |
+ echo "travis_fold:start:load_script"
+ normal="$(echo -e '\033[0m')" red="$normal$(echo -e '\033[01;31m')" green="$normal$(echo -e '\033[01;32m')"
+ configureCVC4() {
+ echo "CVC4 config - $TRAVIS_CVC4_CONFIG";
+ ./configure.sh --name=build --prefix=$(pwd)/build/install --unit-testing $TRAVIS_CVC4_CONFIG
+ }
+ error() {
+ echo;
+ echo "${red}${1}${normal}";
+ echo;
exit 1;
- fi &&
- (echo; echo "${green}EVERYTHING SEEMED TO PASS!${normal}")
+ }
+ makeCheck() {
+ cd build
+ make -j2 check ARGS='-LE regress[1-4]' CVC4_REGRESSION_ARGS='--no-early-exit' || error "BUILD/UNIT/SYSTEM/REGRESSION TEST FAILED"
+ ctest -j2 -L example || error "RUNNING EXAMPLES FAILED"
+ }
+ makeInstallCheck() {
+ cd build
+ make install -j2
+ echo -e "#include <cvc4/cvc4.h>\nint main() { CVC4::ExprManager em; return 0; }" > /tmp/test.cpp
+ $CXX -std=c++11 /tmp/test.cpp -I install/include -L install/lib -lcvc4 -lcln || exit 1
+ }
+ run() {
+ echo "travis_fold:start:$1"
+ echo "Running $1"
+ $1 || exit 1
+ echo "travis_fold:end:$1"
+ }
+ [[ "$TRAVIS_CVC4_CONFIG" == *"symfpu"* ]] && CVC4_SYMFPU_BUILD="yes"
+ [ -n "$CVC4_SYMFPU_BUILD" ] && run contrib/get-symfpu
+ [ -n "$TRAVIS_CVC4" ] && [ -n "$TRAVIS_WITH_LFSC" ] && run contrib/get-lfsc-checker
+ [ -n "$TRAVIS_CVC4" ] && run configureCVC4
+ [ -n "$TRAVIS_CVC4" ] && run makeCheck
+ [ -z "$CVC4_SYMFPU_BUILD" ] && run makeInstallCheck
+ [ -z "$TRAVIS_CVC4" ] && error "Unknown Travis-CI configuration"
+ echo "travis_fold:end:load_script"
+ - echo; echo "${green}EVERYTHING SEEMED TO PASS!${normal}"
+ - ccache -s
matrix:
fast_finish: true
+ include:
+ # Test with GCC
+ - compiler: gcc
+ env:
+ - TRAVIS_CVC4=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_CONFIG='production --language-bindings=java --lfsc'
+ - compiler: gcc
+ env:
+ - TRAVIS_CVC4=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_CONFIG='debug --symfpu --lfsc --no-debug-symbols'
+
+ #
+ # Test with Clang
+ - compiler: clang
+ env:
+ - TRAVIS_CVC4=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_CONFIG='debug --symfpu --cln --gpl --no-debug-symbols --no-proofs'
notifications:
email:
on_success: change