diff options
author | Stefan Agner <stefan@agner.ch> | 2020-06-11 20:04:06 +0200 |
---|---|---|
committer | Petri Latvala <petri.latvala@intel.com> | 2020-06-12 08:02:22 +0300 |
commit | 4e51438ba55854e8584e2aaaa5ba6c6024206a08 (patch) | |
tree | 667a7e9c83d0f1e58b78ec68aca759e428cc831c /scripts | |
parent | a8c256b4feb90201c727d72c168288a676c9d6ef (diff) |
scripts/run-tests.sh: also search path for runner binaries
To make the script also useful when igt_runner/igt_resume binarires are
installed, also search PATH for the binaries.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/run-tests.sh | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index b7e2faa3..8399b6d1 100755 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -67,10 +67,21 @@ fi IGT_TEST_ROOT="`readlink -f ${IGT_TEST_ROOT}`" -function find_runner_binaries +function find_runner_binary # basename { - IGT_RUNNER=$(find_file igt_runner "$ROOT/build/runner" "$ROOT/runner") - IGT_RESUME=$(find_file igt_resume "$ROOT/build/runner" "$ROOT/runner") + base=$1 + shift + + binary=$(find_file "$base" "$ROOT/build/runner" "$ROOT/runner") + if [ -x "$binary" ]; then + echo "$binary" + return 0 + elif binary=$(which "$base"); then + echo "$binary" + return 0 + fi + + return 1 } function download_piglit { @@ -177,8 +188,8 @@ if [ "$USE_PIGLIT" -eq "1" ]; then RESUME_ARGS="resume $NORETRY" LIST_ARGS="print-cmd igt --format {name}" else - find_runner_binaries - if [ ! -x "$IGT_RUNNER" -o ! -x "$IGT_RESUME" ]; then + if ! IGT_RUNNER=$(find_runner_binary igt_runner) || + ! IGT_RESUME=$(find_runner_binary igt_resume); then echo "Could not find igt_runner binaries." echo "Please build the runner, or use Piglit with the -p flag." exit 1 |