+# 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
- ccache
-# We need more than 4G memory for compiling CVC4. Hence, we cannot switch
-# to container-based virtualization environments since they only provide 4G of
-# memory. We will stick with the VM-based environments for now.
-sudo: required
+sudo: false
dist: trusty
-compiler:
- - gcc
- - clang
env:
global:
- # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
- # via the "travis encrypt" command using the project repo's public key
- - secure: "fRfdzYwV10VeW5tVSvy5qpR8ZlkXepR7XWzCulzlHs9SRI2YY20BpzWRjyMBiGu2t7IeJKT7qdjq/CJOQEM8WS76ON7QJ1iymKaRDewDs3OhyPJ71fsFKEGgLky9blk7I9qZh23hnRVECj1oJAVry9IK04bc2zyIEjUYpjRkUAQ="
- - TEST_GROUPS=2
- matrix:
- - TRAVIS_CVC4=yes TRAVIS_CVC4_CHECK_PORTFOLIO=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_JAVA_API_TEST=yes TRAVIS_CVC4_CONFIG='production --enable-language-bindings=java,c --with-lfsc --with-portfolio --enable-gpl'
- - TRAVIS_CVC4=yes TRAVIS_CVC4_CHECK_PORTFOLIO=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_JAVA_API_TEST=yes TRAVIS_CVC4_CONFIG='debug --enable-language-bindings=java,c --with-lfsc --with-portfolio --enable-gpl --disable-debug-symbols' TEST_GROUP=0
- - TRAVIS_CVC4=yes TRAVIS_CVC4_CHECK_PORTFOLIO=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_CONFIG='debug --enable-language-bindings=java,c --with-lfsc --with-portfolio --enable-gpl --disable-debug-symbols' TEST_GROUP=1
- - TRAVIS_CVC4=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_JAVA_API_TEST=yes TRAVIS_CVC4_CONFIG='debug --enable-language-bindings=java,c --with-lfsc --with-cln --enable-gpl --disable-debug-symbols'
- - TRAVIS_CVC4=yes TRAVIS_CVC4_CONFIG='--disable-proof'
- - TRAVIS_CVC4=yes TRAVIS_CVC4_DISTCHECK=yes TRAVIS_CVC4_CONFIG='--enable-proof'
+ - CCACHE_COMPRESS=1
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages: &common_deps
- - libgmp-dev
- - libboost-dev
- - libboost-thread-dev
- - swig
- - libcln-dev
- - openjdk-7-jdk
- antlr3
- - libantlr3c-dev
- - ant-optional
+ - cmake
- cxxtest
- - libreadline-dev
+ - junit4
+ - libantlr3c-dev
+ - libcln-dev
+ - libgmp-dev
+ - libhamcrest-java
+ - openjdk-7-jdk
+ - swig3.0
before_install:
- 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:
+ - ccache -M 1G
+ - ccache -z
- ${CC} --version
- ${CXX} --version
- |
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 --enable-unit-testing $TRAVIS_CVC4_CONFIG ||
- (echo; echo "Trying to print config.log"; cat builds/config.log; error "CONFIGURE FAILED");
+ ./configure.sh --name=build --prefix=$(pwd)/build/install --unit-testing $TRAVIS_CVC4_CONFIG
}
error() {
echo;
echo;
exit 1;
}
- makeDistcheck() {
- make V=1 -j2 distcheck CVC4_REGRESSION_ARGS='--no-early-exit' ||
- error "DISTCHECK (WITH NEWTHEORY TESTS) FAILED";
- }
makeCheck() {
- make V=1 -j2 check CVC4_REGRESSION_ARGS='--no-early-exit' || error "BUILD/TEST FAILED";
- }
- makeCheckPortfolio() {
- make V=1 -j2 check BINARY=pcvc4 CVC4_REGRESSION_ARGS='--fallback-sequential --no-early-exit' RUN_REGRESSION_ARGS= ||
- error "PORTFOLIO TEST FAILED";
+ 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"
}
- JavaApiTest() {
- pushd test/java
- local status=0
- ant || status=1
- popd
- return $status
- }
- makeExamples() {
- make V=1 -j2 examples || error "COULD NOT BUILD EXAMPLES${normal}";
- }
- addNewTheoryTest() {
- contrib/new-theory test_newtheory || error "NEWTHEORY FAILED";
- grep -q '^THEORIES *=.* test_newtheory' src/Makefile.theories || error "NEWTHEORY FAILED";
- contrib/new-theory --alternate test_newtheory test_newalttheory || error "NEWTHEORY-ALTERNATE FAILED";
- grep -q '^THEORIES *=.* test_newalttheory' src/Makefile.theories || error "NEWTHEORY-ALTERNATE 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"
$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" ] && [ -n "$TRAVIS_CVC4_DISTCHECK" ] && run addNewTheoryTest
[ -n "$TRAVIS_CVC4" ] && run configureCVC4
- [ -n "$TRAVIS_CVC4" ] && [ -n "$TRAVIS_CVC4_DISTCHECK" ] && run makeDistcheck
- [ -n "$TRAVIS_CVC4" ] && [ -z "$TRAVIS_CVC4_DISTCHECK" ] && run makeCheck && run makeExamples
- [ -n "$TRAVIS_CVC4" ] && [ -n "$TRAVIS_CVC4_CHECK_PORTFOLIO" ] && run makeCheckPortfolio
- # [ -n "$TRAVIS_CVC4" ] && [ -n "$TRAVIS_CVC4_JAVA_API_TEST" ] && run JavaApiTest
- [ -n "$TRAVIS_COVERITY" ] && echo "Running coverity. Skipping the normal build."
- [ -z "$TRAVIS_CVC4" ] && [ -z "$TRAVIS_COVERITY" ] && error "Unknown Travis-CI configuration"
+ [ -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 GCC7
- # Note: TRAVIS_CVC4_JAVA_API_TEST is only active for TEST_GROUP=0 because
- # test groups only apply to regression tests (no need to repeat the Java
- # tests for both groups).
- - addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- packages:
- - *common_deps
- - g++-7
+ # Test with GCC
+ - compiler: gcc
env:
- - MATRIX_EVAL='CC=gcc-7 && CXX=g++-7'
- - TRAVIS_CVC4=yes TRAVIS_CVC4_CHECK_PORTFOLIO=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_JAVA_API_TEST=yes TRAVIS_CVC4_CONFIG='debug --enable-language-bindings=java,c --with-lfsc --with-portfolio --enable-gpl --disable-debug-symbols' TEST_GROUP=0
- - addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- packages:
- - *common_deps
- - g++-7
+ - TRAVIS_CVC4=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_CONFIG='production --language-bindings=java --lfsc'
+ - compiler: gcc
env:
- - MATRIX_EVAL='CC=gcc-7 && CXX=g++-7'
- - TRAVIS_CVC4=yes TRAVIS_CVC4_CHECK_PORTFOLIO=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_CONFIG='debug --enable-language-bindings=java,c --with-lfsc --with-portfolio --enable-gpl --disable-debug-symbols' TEST_GROUP=1
- # Rule for running Coverity Scan.
- - os: linux
- compiler: gcc
- env:
- - TRAVIS_COVERITY=yes CVC4_REGRESSION_ARGS='--no-early-exit'
- addons:
- # Need to duplicate as addons will be over written.
- apt:
- sources:
- - ubuntu-toolchain-r-test
- packages:
- - *common_deps
- coverity_scan:
- project:
- name: "CVC4/CVC4"
- description: "Build submitted via Travis CI"
- notification_email: timothy.alan.king@gmail.com
- build_command_prepend: "./autogen.sh; ./configure --enable-unit-testing --enable-proof"
- build_command: "make V=1 -j4"
- branch_pattern: coverity_scan
- after_failure:
- - cat /home/travis/build/CVC4/CVC4/cov-int/build-log.txt
+ - 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