diff options
author | Dan Liew <daniel.liew@imperial.ac.uk> | 2017-03-30 14:49:16 +0100 |
---|---|---|
committer | Dan Liew <daniel.liew@imperial.ac.uk> | 2017-03-30 14:49:16 +0100 |
commit | 31d7fa412c673d2e2b0f9fe2abf32afa1b105d5e (patch) | |
tree | 769509fcc09120092d307c26ba92b07228ea3118 | |
parent | 58c5132f82112d2ceef3b676e0bd04f04c940b69 (diff) | |
download | klee-31d7fa412c673d2e2b0f9fe2abf32afa1b105d5e.tar.gz |
[TravisCI] Make handling of `TRAVIS_OS_NAME` more robust by not assuming
that its value not being `linux` implies `osx`.
-rwxr-xr-x | .travis/install-llvm-and-runtime-compiler.sh | 5 | ||||
-rwxr-xr-x | .travis/install-tcmalloc.sh | 5 | ||||
-rwxr-xr-x | .travis/klee.sh | 10 | ||||
-rwxr-xr-x | .travis/stp.sh | 5 | ||||
-rwxr-xr-x | .travis/testing-utils.sh | 5 | ||||
-rwxr-xr-x | .travis/z3.sh | 5 |
6 files changed, 28 insertions, 7 deletions
diff --git a/.travis/install-llvm-and-runtime-compiler.sh b/.travis/install-llvm-and-runtime-compiler.sh index de6f9bbd..8e8e9863 100755 --- a/.travis/install-llvm-and-runtime-compiler.sh +++ b/.travis/install-llvm-and-runtime-compiler.sh @@ -29,7 +29,7 @@ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then llvm-gcc/bin/llvm-gcc test.c -o hello_world ./hello_world fi -else # OSX +elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then # NOTE: We should not easily generalize, since we need the corresponding support of bottled formulas if [ "${LLVM_VERSION}" == "3.4" ]; then brew install llvm34 @@ -37,4 +37,7 @@ else # OSX echo "Error: Requested to install LLVM ${LLVM_VERSION} on macOS, which is not supported" exit 1 fi +else + echo "Unhandled TRAVIS_OS_NAME \"${TRAVIS_OS_NAME}\"" + exit 1 fi diff --git a/.travis/install-tcmalloc.sh b/.travis/install-tcmalloc.sh index a0d825e1..0bc26616 100755 --- a/.travis/install-tcmalloc.sh +++ b/.travis/install-tcmalloc.sh @@ -11,9 +11,12 @@ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make sudo make install fi -else # OSX +elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then if [ ${USE_TCMALLOC:-0} -eq 1 ] ; then echo "Error: Requested to install TCMalloc on macOS, which is not supported" exit 1 fi +else + echo "Unhandled TRAVIS_OS_NAME \"${TRAVIS_OS_NAME}\"" + exit 1 fi diff --git a/.travis/klee.sh b/.travis/klee.sh index a2efc70d..5ee631fa 100755 --- a/.travis/klee.sh +++ b/.travis/klee.sh @@ -13,9 +13,12 @@ if [ "${LLVM_VERSION}" != "2.9" ]; then if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then KLEE_CC=/usr/bin/clang-${LLVM_VERSION} KLEE_CXX=/usr/bin/clang++-${LLVM_VERSION} - else # OSX + elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then KLEE_CC=/usr/local/bin/clang-${LLVM_VERSION} KLEE_CXX=/usr/local/bin/clang++-${LLVM_VERSION} + else + echo "Unhandled TRAVIS_OS_NAME \"${TRAVIS_OS_NAME}\"" + exit 1 fi else # Just use pre-built llvm-gcc downloaded earlier @@ -127,9 +130,12 @@ source ${KLEE_SRC}/.travis/sanitizer_flags.sh if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then LLVM_CONFIG="/usr/lib/llvm-${LLVM_VERSION}/bin/llvm-config" LLVM_BUILD_DIR="/usr/lib/llvm-${LLVM_VERSION}/build" -else # OSX +elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then LLVM_CONFIG="/usr/local/bin/llvm-config-${LLVM_VERSION}" LLVM_BUILD_DIR="$(${LLVM_CONFIG} --src-root)" +else + echo "Unhandled TRAVIS_OS_NAME \"${TRAVIS_OS_NAME}\"" + exit 1 fi ############################################################################### diff --git a/.travis/stp.sh b/.travis/stp.sh index 412f7613..0112ae31 100755 --- a/.travis/stp.sh +++ b/.travis/stp.sh @@ -21,10 +21,13 @@ if [ "x${STP_VERSION}" != "x" ]; then CFLAGS="${SANITIZER_C_FLAGS}" \ CXXFLAGS="${SANITIZER_CXX_FLAGS}" \ cmake -DCMAKE_INSTALL_PREFIX=/usr .. - else # OSX + elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then CFLAGS="${SANITIZER_C_FLAGS}" \ CXXFLAGS="${SANITIZER_CXX_FLAGS}" \ cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. + else + echo "Unhandled TRAVIS_OS_NAME \"${TRAVIS_OS_NAME}\"" + exit 1 fi make sudo make install diff --git a/.travis/testing-utils.sh b/.travis/testing-utils.sh index 29295be2..153a5546 100755 --- a/.travis/testing-utils.sh +++ b/.travis/testing-utils.sh @@ -21,9 +21,12 @@ if [ "${LLVM_VERSION}" != "2.9" ]; then if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo cp lib* /usr/lib/ sudo cp -r include/gtest /usr/include - else # OSX + elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then sudo cp lib* /usr/local/lib/ sudo cp -r include/gtest /usr/local/include + else + echo "Unhandled TRAVIS_OS_NAME \"${TRAVIS_OS_NAME}\"" + exit 1 fi else # LLVM2.9 on the other hand is a pain diff --git a/.travis/z3.sh b/.travis/z3.sh index f8ae6e0b..a4c00f82 100755 --- a/.travis/z3.sh +++ b/.travis/z3.sh @@ -12,6 +12,9 @@ fi if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then # Should we install libz3-dbg too? sudo apt-get -y install libz3 libz3-dev -else # OSX +elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then brew install z3 +else + echo "Unhandled TRAVIS_OS_NAME \"${TRAVIS_OS_NAME}\"" + exit 1 fi |