From 48a5b1c0a95a3c45b65c1b4f10d13ca2fa852bf9 Mon Sep 17 00:00:00 2001 From: Douglas Stebila Date: Thu, 1 Aug 2019 14:57:22 -0400 Subject: [PATCH] Move Travis test scripts into .travis.yml --- .travis.yml | 20 ++++++++++--- .travis/all-tests.sh | 71 -------------------------------------------- .travis/defs.sh | 6 ---- 3 files changed, 16 insertions(+), 81 deletions(-) delete mode 100755 .travis/all-tests.sh delete mode 100644 .travis/defs.sh diff --git a/.travis.yml b/.travis.yml index a74e916d7..e7eacc437 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,20 +18,32 @@ matrix: - os: osx compiler: clang env: - - CC_OVERRIDE=clang - WITH_OPENSSL=1 before_install: - brew install doxygen graphviz - pip3 install pytest script: - - .travis/all-tests.sh + - autoreconf -i + - ./configure --enable-silent-rules + - make + - make test + - ./configure --enable-silent-rules --disable-shared + - make clean + - make + - make test - os: osx compiler: clang env: - - CC_OVERRIDE=clang - WITH_OPENSSL=0 before_install: - brew install doxygen graphviz - pip3 install pytest script: - - .travis/all-tests.sh + - autoreconf -i + - ./configure --enable-silent-rules --without-openssl + - make + - make test + - ./configure --enable-silent-rules --disable-shared + - make clean + - make + - make test diff --git a/.travis/all-tests.sh b/.travis/all-tests.sh deleted file mode 100755 index 6f76a8efd..000000000 --- a/.travis/all-tests.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -### -# Run all tests for Travis -# -# Need to set the following environment variables: -# - CC_OVERRIDE: whatever compiler you want to use -### - -source $(dirname $0)/defs.sh - -( # this is like the start of a "try...catch" block, see https://stackoverflow.com/questions/22009364/is-there-a-try-catch-command-in-bash#22010339 - set -e - - # See what has been modified (ignoring submodules because they are likely patched) - MODIFIED=$(git status -s) - if [[ ! -z "${MODIFIED}" ]]; - then - ${PRINT_RED} - echo "There are modified files present in the directory prior to .travis/all-tests.sh. This may indicate that some files should be added to .gitignore or need to be committed. Travis tests will not yield correct results if modified files are present. Please fix and try again."; - ${PRINT_RESET} - git status -s - exit 1; - fi; - - if [ -z ${CC_OVERRIDE+x} ]; then - echo "CC_OVERRIDE environment variable not set." - exit 1 - fi - - export CC=$CC_OVERRIDE - - # construct configure arguments - enable_disable_str= - - if [[ ${WITH_OPENSSL} == 1 ]];then - enable_disable_str=" --with-openssl" - else - enable_disable_str=" --without-openssl" - fi - - if [[ ${ENABLE_SIG_PICNIC} == 0 ]];then - enable_disable_str+=" --disable-sig-picnic" - fi - - # build and run - autoreconf -i - ./configure --enable-silent-rules ${enable_disable_str} - make clean - make - make docs - make test - - # Excercise static build of liboqs too - ./configure --enable-shared=no --enable-silent-rules ${enable_disable_str} - make clean - make - make docs - make test - - for f in $(ls .travis/*-check.sh); do - bash $f; - done -) # the end of the "try...catch" block -ERROR_CODE=$? -if [ ${ERROR_CODE} -ne 0 ]; then - ${PRINT_RED} - echo "An error occurred while running all-tests.sh. If the previous line is a green success message, that is likely what the *last* successful command, and the next command is what caused the error."; - ${PRINT_RESET} - exit 1; -fi diff --git a/.travis/defs.sh b/.travis/defs.sh deleted file mode 100644 index ac0817c70..000000000 --- a/.travis/defs.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -PRINT_GREEN="tput setaf 2" -PRINT_RED="tput setaf 1" -PRINT_RESET="tput sgr 0" -PRINT_YELLOW="tput setaf 3"