public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 1/1] tests/tools_test: Find the tool binaries also from bindir
Date: Mon, 5 Nov 2018 13:42:52 +0200	[thread overview]
Message-ID: <20181105114252.GV17124@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20181105105048.s6gdr4nxacpixymn@ahiler-desk1.fi.intel.com>

On Mon, Nov 05, 2018 at 12:50:48PM +0200, Arkadiusz Hiler wrote:
> On Mon, Oct 08, 2018 at 03:10:42PM +0300, Petri Latvala wrote:
> > Also print what directory gets used.
> > 
> > Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> > ---
> >  tests/tools_test.c | 27 ++++++++++++++++++++-------
> >  1 file changed, 20 insertions(+), 7 deletions(-)
> > 
> > diff --git a/tests/tools_test.c b/tests/tools_test.c
> > index a0025bed..ac8717c5 100644
> > --- a/tests/tools_test.c
> > +++ b/tests/tools_test.c
> > @@ -59,20 +59,33 @@ static void assert_cmd_success(int exec_return)
> >  	igt_assert_eq(exec_return, IGT_EXIT_SUCCESS);
> >  }
> >  
> > +bool chdir_to_tools_dir()
> > +{
> > +	char path[4096];
> 
> use PATH_MAX
> 
> > +
> > +	/* Try TOOLS relative to cwd */
> > +	if (chdir(TOOLS) == 0)
> > +		return true;
> 
> 1st chdir(TOOLS)
> 
> > +
> > +	/* Try TOOLS and install dir relative to test binary */
> > +	if (readlink("/proc/self/exe", path, sizeof(path)) > 0)
> > +		chdir(dirname(path));
> > +
> > +	return chdir(TOOLS) == 0 || chdir("../../bin") == 0;
> 
> 2nd chdir(TOOLS)
> 
> one should be enough

TOOLS is "../blahblah" and chdir(dirname(path)) changes what the second one does.


-- 
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2018-11-05 11:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-08 12:10 [igt-dev] [PATCH i-g-t 1/1] tests/tools_test: Find the tool binaries also from bindir Petri Latvala
2018-10-08 13:28 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/1] " Patchwork
2018-10-08 14:41 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2018-10-08 15:49 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-11-05 10:50 ` [igt-dev] [PATCH i-g-t 1/1] " Arkadiusz Hiler
2018-11-05 11:42   ` Petri Latvala [this message]
2018-11-05 13:45     ` Arkadiusz Hiler

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=20181105114252.GV17124@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=arkadiusz.hiler@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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