Commit 62b03ef3 by Edward Thomson

ci: limit test runner to build path

We provide `BUILD_PATH` to our build script; provide it and mutate
`PATH` when running our tests as well.
parent 8044fa84
...@@ -13,6 +13,8 @@ fi ...@@ -13,6 +13,8 @@ fi
SOURCE_DIR=${SOURCE_DIR:-$( cd "$( dirname "${BASH_SOURCE[0]}" )" && dirname $( pwd ) )} SOURCE_DIR=${SOURCE_DIR:-$( cd "$( dirname "${BASH_SOURCE[0]}" )" && dirname $( pwd ) )}
BUILD_DIR=$(pwd) BUILD_DIR=$(pwd)
BUILD_PATH=${BUILD_PATH:=$PATH}
CTEST=$(which ctest)
TMPDIR=${TMPDIR:-/tmp} TMPDIR=${TMPDIR:-/tmp}
USER=${USER:-$(whoami)} USER=${USER:-$(whoami)}
...@@ -52,7 +54,11 @@ run_test() { ...@@ -52,7 +54,11 @@ run_test() {
RETURN_CODE=0 RETURN_CODE=0
CLAR_SUMMARY="${BUILD_DIR}/results_${1}.xml" ctest -V -R "^${1}$" || RETURN_CODE=$? && true (
export PATH="${BUILD_PATH}"
export CLAR_SUMMARY="${BUILD_DIR}/results_${1}.xml"
"${CTEST}" -V -R "^${1}$"
) || RETURN_CODE=$? && true
if [ "$RETURN_CODE" -eq 0 ]; then if [ "$RETURN_CODE" -eq 0 ]; then
FAILED=0 FAILED=0
...@@ -73,9 +79,21 @@ run_test() { ...@@ -73,9 +79,21 @@ run_test() {
fi fi
} }
indent() { sed "s/^/ /"; }
if [[ "$(uname -s)" == MINGW* ]]; then
BUILD_PATH=$(cygpath "$BUILD_PATH")
fi
# Configure the test environment; run them early so that we're certain # Configure the test environment; run them early so that we're certain
# that they're started by the time we need them. # that they're started by the time we need them.
echo "CTest version:"
env PATH="${BUILD_PATH}" "${CTEST}" --version | head -1 2>&1 | indent
echo ""
echo "##############################################################################" echo "##############################################################################"
echo "## Configuring test environment" echo "## Configuring test environment"
echo "##############################################################################" echo "##############################################################################"
...@@ -348,7 +366,7 @@ if [ -z "$SKIP_FUZZERS" ]; then ...@@ -348,7 +366,7 @@ if [ -z "$SKIP_FUZZERS" ]; then
echo "## Running fuzzers" echo "## Running fuzzers"
echo "##############################################################################" echo "##############################################################################"
ctest -V -R 'fuzzer' env PATH="${BUILD_PATH}" "${CTEST}" -V -R 'fuzzer'
fi fi
cleanup cleanup
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment