diff options
Diffstat (limited to '.travis/run.sh')
| -rwxr-xr-x | .travis/run.sh | 63 |
1 files changed, 41 insertions, 22 deletions
diff --git a/.travis/run.sh b/.travis/run.sh index 17358655..ab12ac3c 100755 --- a/.travis/run.sh +++ b/.travis/run.sh @@ -1,28 +1,47 @@ -#!/bin/bash +#!/bin/bash -ex -set -e -set -x +SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}") -if [[ "$(uname -s)" == "Darwin" ]]; then +if [[ "${TOXENV}" == "pypy" ]]; then + PYENV_ROOT="$HOME/.pyenv" + PATH="$PYENV_ROOT/bin:$PATH" eval "$(pyenv init -)" - if [[ "${OPENSSL}" != "0.9.8" ]]; then - # set our flags to use homebrew openssl - export ARCHFLAGS="-arch x86_64" - export LDFLAGS="-L/usr/local/opt/openssl/lib" - export CFLAGS="-I/usr/local/opt/openssl/include" - # The Travis OS X jobs are run for two versions - # of OpenSSL, but we only need to run the - # CommonCrypto backend tests once. Exclude - # CommonCrypto when we test against brew OpenSSL - export TOX_FLAGS="--backend=openssl" - fi +fi +if [ -n "${LIBRESSL}" ]; then + LIBRESSL_DIR="ossl-2/${LIBRESSL}" + export CFLAGS="-Werror -Wno-error=deprecated-declarations -Wno-error=discarded-qualifiers -Wno-error=unused-function -I$HOME/$LIBRESSL_DIR/include" + export PATH="$HOME/$LIBRESSL_DIR/bin:$PATH" + export LDFLAGS="-L$HOME/$LIBRESSL_DIR/lib -Wl,-rpath=$HOME/$LIBRESSL_DIR/lib" +fi + +if [ -n "${OPENSSL}" ]; then + . "$SCRIPT_DIR/openssl_config.sh" + export PATH="$HOME/$OPENSSL_DIR/bin:$PATH" + export CFLAGS="${CFLAGS} -I$HOME/$OPENSSL_DIR/include" + # rpath on linux will cause it to use an absolute path so we don't need to + # do LD_LIBRARY_PATH + export LDFLAGS="-L$HOME/$OPENSSL_DIR/lib -Wl,-rpath=$HOME/$OPENSSL_DIR/lib" +fi + +source ~/.venv/bin/activate + +if [ -n "${DOCKER}" ]; then + # We will be able to drop the -u once we switch the default container user in the + # dockerfiles. + docker run --rm -u 2000:2000 \ + -v "${TRAVIS_BUILD_DIR}":"${TRAVIS_BUILD_DIR}" \ + -v "${HOME}/wycheproof":/wycheproof \ + -w "${TRAVIS_BUILD_DIR}" \ + -e TOXENV "${DOCKER}" \ + /bin/sh -c "tox -- --wycheproof-root='/wycheproof'" +elif [ -n "${TOXENV}" ]; then + tox -- --wycheproof-root="$HOME/wycheproof" else - if [[ "${TOXENV}" == "pypy" ]]; then - PYENV_ROOT="$HOME/.pyenv" - PATH="$PYENV_ROOT/bin:$PATH" - eval "$(pyenv init -)" - pyenv global pypy-2.6.0 + downstream_script="${TRAVIS_BUILD_DIR}/.travis/downstream.d/${DOWNSTREAM}.sh" + if [ ! -x "$downstream_script" ]; then + exit 1 fi + $downstream_script install + pip install . + $downstream_script run fi -source ~/.venv/bin/activate -tox -- $TOX_FLAGS |
