Merge pull request #1008 from blueyed/tests-run-from-tests-dir

tests/run: change to script dir first
This commit is contained in:
Emmanuel Lepage Vallée 2016-08-20 00:15:57 -04:00 committed by GitHub
commit cbda387677

View file

@ -17,21 +17,21 @@ if [ "$CI" = true ]; then
set -x
fi
# Either the build dir is passed in $CMAKE_BINARY_DIR or we guess based on $PWD
build_dir="$CMAKE_BINARY_DIR"
if [ -z "$build_dir" ]; then
if [ -d "$PWD/build" ]; then
build_dir="$PWD/build"
else
build_dir="$PWD"
fi
fi
# Change to file's dir (POSIXly).
cd -P -- "$(dirname -- "$0")"
this_dir=$PWD
source_dir="$PWD/.."
# Either the build dir is passed in $CMAKE_BINARY_DIR or we guess based on $PWD
build_dir="$CMAKE_BINARY_DIR"
if [ -z "$build_dir" ]; then
if [ -d "$source_dir/build" ]; then
build_dir="$source_dir/build"
else
build_dir="$source_dir"
fi
fi
# Get test files: test*, or the ones provided as args (relative to tests/).
if [ $# != 0 ]; then
tests="$@"