From 6566f3ca2893972a10e63b0308ff9b30a2d6a575 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Sat, 17 Dec 2016 17:36:08 +0000 Subject: [TravisCI] Fix bug where TravisCI build scripts would carry on executing even though configure/build failed. This due to using the `&&` operator which means failure of commands to execute in this compound statement will not trigger the script to exit as requested by `set -e`. --- .travis/klee.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.travis/klee.sh b/.travis/klee.sh index 64bfcb67..36b22049 100755 --- a/.travis/klee.sh +++ b/.travis/klee.sh @@ -146,7 +146,8 @@ if [ "X${USE_CMAKE}" == "X1" ]; then ${KLEE_ASSERTS_OPTION} \ -DENABLE_TESTS=TRUE \ -DLIT_ARGS="-v" \ - ${KLEE_SRC} && make + ${KLEE_SRC} + make else # Build KLEE # Note: ENABLE_SHARED=0 is required because llvm-2.9 is incorectly packaged @@ -161,10 +162,11 @@ else ${KLEE_METASMT_CONFIGURE_OPTION} \ ${KLEE_UCLIBC_CONFIGURE_OPTION} \ ${TCMALLOC_OPTION} \ - CXXFLAGS="${COVERAGE_FLAGS}" \ - && make DISABLE_ASSERTIONS=${DISABLE_ASSERTIONS} \ - ENABLE_OPTIMIZED=${ENABLE_OPTIMIZED} \ - ENABLE_SHARED=0 + CXXFLAGS="${COVERAGE_FLAGS}" + make \ + DISABLE_ASSERTIONS=${DISABLE_ASSERTIONS} \ + ENABLE_OPTIMIZED=${ENABLE_OPTIMIZED} \ + ENABLE_SHARED=0 fi ############################################################################### # Testing -- cgit 1.4.1 From ff8fa19642baed8100c7d47bf1e92aaf864758f0 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Sat, 17 Dec 2016 17:38:14 +0000 Subject: [TravisCI] Remove `set +e` commands so that when running tests we fail fast rather than continuing to run the tests (due to `set -e` at the beginning of the script). Although this gives less information in the event of a broken build it means our builds might finish faster if they are broken and it also simplifies the script significantly. --- .travis/klee.sh | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.travis/klee.sh b/.travis/klee.sh index 36b22049..ee65781f 100755 --- a/.travis/klee.sh +++ b/.travis/klee.sh @@ -168,17 +168,12 @@ else ENABLE_OPTIMIZED=${ENABLE_OPTIMIZED} \ ENABLE_SHARED=0 fi -############################################################################### -# Testing -############################################################################### -set +e # We want to let all the tests run before we exit ############################################################################### # Unit tests ############################################################################### if [ "X${USE_CMAKE}" == "X1" ]; then make unittests - RETURN="$?" else # The unittests makefile doesn't seem to have been packaged so get it from SVN sudo mkdir -p /usr/lib/llvm-${LLVM_VERSION}/build/unittests/ @@ -190,7 +185,6 @@ else DISABLE_ASSERTIONS=${DISABLE_ASSERTIONS} \ ENABLE_OPTIMIZED=${ENABLE_OPTIMIZED} \ ENABLE_SHARED=0 - RETURN="$?" fi ############################################################################### @@ -198,7 +192,6 @@ fi ############################################################################### if [ "X${USE_CMAKE}" == "X1" ]; then make integrationtests - RETURN="${RETURN}$?" else # Note can't use ``make check`` because llvm-lit is not available cd test @@ -208,9 +201,7 @@ else ENABLE_OPTIMIZED=${ENABLE_OPTIMIZED} \ ENABLE_SHARED=0 - set +e # We want to let all the tests run before we exit lit -v . - RETURN="${RETURN}$?" fi #generate and upload coverage if COVERAGE is set @@ -244,10 +235,3 @@ if [ ${COVERAGE} -eq 1 ]; then tar -zcvf coverage.tar.gz coverage/ curl --form "file=@coverage.tar.gz" -u ${USER}:${PASSWORD} ${COVERAGE_SERVER} fi -############################################################################### -# Result -############################################################################### -if [ "${RETURN}" != "00" ]; then - echo "Running tests failed" - exit 1 -fi -- cgit 1.4.1 From fd7d94baa3e5a8462d70e975da0cf09d435c0776 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Sat, 17 Dec 2016 23:56:41 +0000 Subject: [TravisCI] When building with the old build system move back to the root of the build tree after doing the hack the generate the lit configuration files. This will make it easier in the future to run more test configurations (e.g. by passing options to lit to change KLEE's behaviour). --- .travis/klee.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis/klee.sh b/.travis/klee.sh index ee65781f..e1adc6bc 100755 --- a/.travis/klee.sh +++ b/.travis/klee.sh @@ -200,8 +200,8 @@ else DISABLE_ASSERTIONS=${DISABLE_ASSERTIONS} \ ENABLE_OPTIMIZED=${ENABLE_OPTIMIZED} \ ENABLE_SHARED=0 - - lit -v . + cd ../ + lit -v test/ fi #generate and upload coverage if COVERAGE is set -- cgit 1.4.1