public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: Stefan Agner <stefan@agner.ch>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] scripts/run-tests.sh: also search path for runner binaries
Date: Fri, 12 Jun 2020 08:01:08 +0300	[thread overview]
Message-ID: <20200612050108.GO9497@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20200611180406.629107-1-stefan@agner.ch>

On Thu, Jun 11, 2020 at 08:04:06PM +0200, Stefan Agner wrote:
> 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>


> ---
>  scripts/run-tests.sh | 21 ++++++++++++++++-----
>  1 file 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
> -- 
> 2.27.0
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2020-06-12  5:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11 18:04 [igt-dev] [PATCH i-g-t] scripts/run-tests.sh: also search path for runner binaries Stefan Agner
2020-06-11 18:49 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2020-06-12  5:01 ` Petri Latvala [this message]
2020-06-12  5:06   ` [igt-dev] [PATCH i-g-t] " Petri Latvala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200612050108.GO9497@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=stefan@agner.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox