From: Marius Vlad Subject: Re: [PATCH i-g-t] igt_core: Search "." as final fallback for igt_fopen_data() Date: Fri, 27 May 2016 12:41:25 +0300 Message-ID: <20160527094124.GA5415@mcvlad-wk.rb.intel.com> References: <1464303725-7800-1-git-send-email-matthew.d.roper@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1045263941==" Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTP id 064AA6EBCE for ; Fri, 27 May 2016 09:37:46 +0000 (UTC) In-Reply-To: <1464303725-7800-1-git-send-email-matthew.d.roper@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Matt Roper Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============1045263941== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Pushed. On Thu, May 26, 2016 at 04:02:05PM -0700, Matt Roper wrote: > Some validation teams seem to run tests out of source directories that > have been nfs mounted or rsync'd to different locations on the target > machine. This causes the igt_srcdir that the tests were built with to > be invalid on the machine the tests get run on. Add the current > directory as a final fallback for data file searches. >=20 > Reference: https://bugs.freedesktop.org/show_bug.cgi?id=3D92248 > Cc: Humberto Israel Perez Rodriguez > Signed-off-by: Matt Roper > --- > lib/igt_core.c | 4 ++++ > lib/igt_core.h | 4 ++-- > 2 files changed, 6 insertions(+), 2 deletions(-) >=20 > diff --git a/lib/igt_core.c b/lib/igt_core.c > index 56061c3..92a875c 100644 > --- a/lib/igt_core.c > +++ b/lib/igt_core.c > @@ -1882,6 +1882,10 @@ FILE *__igt_fopen_data(const char* igt_srcdir, con= st char* igt_datadir, > snprintf(path, sizeof(path), "%s/%s", igt_srcdir, filename); > fp =3D fopen(path, "r"); > } > + if (!fp) { > + snprintf(path, sizeof(path), "./%s", filename); > + fp =3D fopen(path, "r"); > + } > =20 > if (!fp) > igt_critical("Could not open data file \"%s\": %s", filename, > diff --git a/lib/igt_core.h b/lib/igt_core.h > index 1b62371..5995233 100644 > --- a/lib/igt_core.h > +++ b/lib/igt_core.h > @@ -842,8 +842,8 @@ FILE *__igt_fopen_data(const char* igt_srcdir, const = char* igt_datadir, > * igt_fopen_data: > * @filename: filename to open. > * > - * Open a datafile for test, first try from installation directory > - * then from build directory. > + * Open a datafile for test, first try from installation directory, > + * then from build directory, and finally from current directory. > */ > #define igt_fopen_data(filename) \ > __igt_fopen_data(IGT_SRCDIR, IGT_DATADIR, filename) > --=20 > 2.1.4 >=20 > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx --J2SCkAp4GZ/dPZZf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJXSBZEAAoJELmLWIAQzyE+9BQH/2DyDT0OzOA8Yh1IY1bUNJR7 n0lVAs5hQt5s2x0JdAl88gLK7JdzHbifK3OKiBLx4Qfd31qcibqHGi/92sNn146j r1P9jTBiY2nc7Tk/bjStSjNDW/SRIOmsSdPV5D6z4tGQD2lTv2bWfhRTTrw3K2gC Sb2B0ox0ueQYaXACGji3/ZT63OUM3S8JHeVk++uZg9lVnajm7fgL7niKsoeJycGQ KozgDTOyxKRQcZeqDgBsRlc/gVah3d6xuhdhZfayHmQT8rqeeQDTESXwqJllX8Sh 8qxwKT1BERauGbaY/NKm914n7nI02Yya8idrMy0xehVehb+WPlDgSp0jnIcuBeY= =bNRY -----END PGP SIGNATURE----- --J2SCkAp4GZ/dPZZf-- --===============1045263941== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============1045263941==--