All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/1] tests/tools_test: Find the tool binaries also from bindir
@ 2018-10-08 12:10 Petri Latvala
  2018-10-08 13:28 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/1] " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Petri Latvala @ 2018-10-08 12:10 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

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];
+
+	/* Try TOOLS relative to cwd */
+	if (chdir(TOOLS) == 0)
+		return true;
+
+	/* 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;
+}
+
 igt_main
 {
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		char path[4096];
-
-		/* Try to guess where the TOOLS are! */
-		if (access(TOOLS, F_OK) &&
-		    readlink("/proc/self/exe", path, sizeof(path)) > 0)
-			chdir(dirname(path));
+		char *path;
 
-		igt_require_f(chdir(TOOLS) == 0,
+		igt_require_f(chdir_to_tools_dir(),
 			      "Unable to determine the tools directory, expecting them in $cwd/" TOOLS " or $path/" TOOLS "\n");
+		path = get_current_dir_name();
+		igt_info("Using tools from %s\n", path);
+		free(path);
 	}
 
 	igt_subtest("sysfs_l3_parity") {
-- 
2.18.0

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/1] tests/tools_test: Find the tool binaries also from bindir
  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 ` Patchwork
  2018-10-08 14:41 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-10-08 13:28 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/1] tests/tools_test: Find the tool binaries also from bindir
URL   : https://patchwork.freedesktop.org/series/50685/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4944 -> IGTPW_1924 =

== Summary - FAILURE ==

  Serious unknown changes coming with IGTPW_1924 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1924, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/50685/revisions/1/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in IGTPW_1924:

  === IGT changes ===

    ==== Possible regressions ====

    igt@drv_selftest@live_hangcheck:
      fi-icl-u:           PASS -> INCOMPLETE

    
== Known issues ==

  Here are the changes found in IGTPW_1924 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_suspend@basic-s3:
      fi-kbl-soraka:      NOTRUN -> INCOMPLETE (fdo#107859, fdo#107556, fdo#107774)

    igt@kms_frontbuffer_tracking@basic:
      fi-byt-clapper:     NOTRUN -> FAIL (fdo#103167)

    igt@kms_pipe_crc_basic@hang-read-crc-pipe-b:
      fi-byt-clapper:     NOTRUN -> FAIL (fdo#107362, fdo#103191)

    igt@pm_rpm@module-reload:
      fi-hsw-peppy:       NOTRUN -> DMESG-WARN (fdo#107603, fdo#106386)

    
    ==== Possible fixes ====

    igt@pm_rpm@module-reload:
      fi-glk-j4005:       DMESG-WARN (fdo#107726) -> PASS

    
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#106386 https://bugs.freedesktop.org/show_bug.cgi?id=106386
  fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
  fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556
  fdo#107603 https://bugs.freedesktop.org/show_bug.cgi?id=107603
  fdo#107726 https://bugs.freedesktop.org/show_bug.cgi?id=107726
  fdo#107774 https://bugs.freedesktop.org/show_bug.cgi?id=107774
  fdo#107859 https://bugs.freedesktop.org/show_bug.cgi?id=107859


== Participating hosts (45 -> 43) ==

  Additional (5): fi-kbl-soraka fi-byt-clapper fi-hsw-peppy fi-bwr-2160 fi-kbl-r 
  Missing    (7): fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-icl-u2 fi-snb-2520m fi-ctg-p8600 fi-bdw-samus 


== Build changes ==

    * IGT: IGT_4670 -> IGTPW_1924

  CI_DRM_4944: 66bd263b99fd264b57432c232756baf95b0a6255 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1924: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1924/
  IGT_4670: 7e066794d2ea860f4199fd67549080de17b6b852 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1924/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/1] tests/tools_test: Find the tool binaries also from bindir
  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 ` 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
  3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-10-08 14:41 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/1] tests/tools_test: Find the tool binaries also from bindir
URL   : https://patchwork.freedesktop.org/series/50685/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4944 -> IGTPW_1925 =

== Summary - WARNING ==

  Minor unknown changes coming with IGTPW_1925 need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1925, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/50685/revisions/1/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in IGTPW_1925:

  === IGT changes ===

    ==== Warnings ====

    igt@pm_rpm@module-reload:
      fi-hsw-4770r:       PASS -> SKIP

    
== Known issues ==

  Here are the changes found in IGTPW_1925 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_module_reload@basic-reload-inject:
      fi-hsw-4770r:       PASS -> DMESG-WARN (fdo#107425, fdo#107924)

    igt@gem_exec_suspend@basic-s3:
      fi-kbl-soraka:      NOTRUN -> INCOMPLETE (fdo#107556, fdo#107774, fdo#107859)

    igt@kms_frontbuffer_tracking@basic:
      fi-byt-clapper:     NOTRUN -> FAIL (fdo#103167)

    igt@pm_rpm@module-reload:
      fi-hsw-peppy:       NOTRUN -> DMESG-WARN (fdo#106386, fdo#107603)

    
    ==== Possible fixes ====

    igt@pm_rpm@module-reload:
      fi-glk-j4005:       DMESG-WARN (fdo#107726) -> PASS

    
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#106386 https://bugs.freedesktop.org/show_bug.cgi?id=106386
  fdo#107425 https://bugs.freedesktop.org/show_bug.cgi?id=107425
  fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556
  fdo#107603 https://bugs.freedesktop.org/show_bug.cgi?id=107603
  fdo#107726 https://bugs.freedesktop.org/show_bug.cgi?id=107726
  fdo#107774 https://bugs.freedesktop.org/show_bug.cgi?id=107774
  fdo#107859 https://bugs.freedesktop.org/show_bug.cgi?id=107859
  fdo#107924 https://bugs.freedesktop.org/show_bug.cgi?id=107924


== Participating hosts (45 -> 43) ==

  Additional (6): fi-kbl-soraka fi-hsw-peppy fi-bwr-2160 fi-kbl-7560u fi-byt-clapper fi-kbl-r 
  Missing    (8): fi-ilk-m540 fi-byt-squawks fi-icl-u2 fi-bsw-cyan fi-snb-2520m fi-ctg-p8600 fi-pnv-d510 fi-bdw-samus 


== Build changes ==

    * IGT: IGT_4670 -> IGTPW_1925

  CI_DRM_4944: 66bd263b99fd264b57432c232756baf95b0a6255 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1925: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1925/
  IGT_4670: 7e066794d2ea860f4199fd67549080de17b6b852 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1925/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/1] tests/tools_test: Find the tool binaries also from bindir
  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 ` Patchwork
  2018-11-05 10:50 ` [igt-dev] [PATCH i-g-t 1/1] " Arkadiusz Hiler
  3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-10-08 15:49 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/1] tests/tools_test: Find the tool binaries also from bindir
URL   : https://patchwork.freedesktop.org/series/50685/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4670_full -> IGTPW_1925_full =

== Summary - WARNING ==

  Minor unknown changes coming with IGTPW_1925_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1925_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/50685/revisions/1/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in IGTPW_1925_full:

  === IGT changes ===

    ==== Warnings ====

    igt@kms_flip@flip-vs-dpms-off-vs-modeset:
      shard-apl:          PASS -> SKIP +21

    igt@perf_pmu@rc6:
      shard-kbl:          PASS -> SKIP

    igt@pm_rc6_residency@rc6-accuracy:
      shard-kbl:          SKIP -> PASS +1

    igt@tools_test@tools_test:
      shard-apl:          SKIP -> PASS
      shard-glk:          SKIP -> PASS
      shard-snb:          SKIP -> PASS
      shard-hsw:          SKIP -> PASS +1

    
== Known issues ==

  Here are the changes found in IGTPW_1925_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_workarounds@suspend-resume-fd:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665)

    igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
      shard-glk:          PASS -> FAIL (fdo#108145)

    igt@kms_color@pipe-a-ctm-max:
      shard-apl:          PASS -> FAIL (fdo#108147)

    igt@kms_color@pipe-a-degamma:
      shard-apl:          PASS -> FAIL (fdo#108145, fdo#104782)

    igt@kms_cursor_crc@cursor-128x128-suspend:
      shard-apl:          PASS -> FAIL (fdo#103232, fdo#103191)

    igt@kms_cursor_crc@cursor-64x64-dpms:
      shard-kbl:          PASS -> FAIL (fdo#103232)
      shard-apl:          PASS -> FAIL (fdo#103232) +2

    igt@kms_cursor_crc@cursor-64x64-sliding:
      shard-glk:          PASS -> FAIL (fdo#103232) +5

    igt@kms_frontbuffer_tracking@fbc-1p-rte:
      shard-apl:          PASS -> DMESG-WARN (fdo#108131, fdo#103558)

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
      shard-glk:          PASS -> FAIL (fdo#103167) +9

    igt@kms_plane@plane-position-covered-pipe-a-planes:
      shard-glk:          PASS -> FAIL (fdo#103166)
      shard-kbl:          PASS -> FAIL (fdo#103166)

    igt@kms_plane_multiple@atomic-pipe-c-tiling-x:
      shard-apl:          PASS -> FAIL (fdo#103166)

    igt@pm_rpm@dpms-mode-unset-non-lpsp:
      shard-apl:          PASS -> DMESG-WARN (fdo#105602, fdo#103558) +25

    
    ==== Possible fixes ====

    igt@kms_ccs@pipe-b-crc-sprite-planes-basic:
      shard-apl:          FAIL (fdo#106510, fdo#105458) -> SKIP

    igt@kms_cursor_crc@cursor-128x42-random:
      shard-glk:          FAIL (fdo#103232) -> PASS +2

    igt@kms_cursor_crc@cursor-64x21-onscreen:
      shard-apl:          FAIL (fdo#103232) -> SKIP

    igt@kms_cursor_crc@cursor-64x21-random:
      shard-apl:          FAIL (fdo#103232) -> PASS +5

    igt@kms_cursor_crc@cursor-64x21-sliding:
      shard-kbl:          FAIL (fdo#103232) -> PASS

    igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
      shard-glk:          FAIL (fdo#105363) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-indfb-fliptrack:
      shard-glk:          DMESG-WARN (fdo#106538, fdo#105763) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
      shard-apl:          FAIL (fdo#103167) -> PASS +4

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
      shard-kbl:          FAIL (fdo#103167) -> PASS

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-blt:
      shard-glk:          FAIL (fdo#103167) -> PASS +3

    igt@kms_plane@pixel-format-pipe-a-planes:
      shard-snb:          FAIL (fdo#103166, fdo#107749) -> PASS

    {igt@kms_plane_alpha_blend@pipe-a-alpha-transparant-fb}:
      shard-apl:          FAIL (fdo#108145) -> SKIP +1

    igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
      shard-apl:          FAIL (fdo#103166) -> PASS +5
      shard-kbl:          FAIL (fdo#103166) -> PASS +2

    igt@kms_rotation_crc@sprite-rotation-180:
      shard-snb:          FAIL (fdo#103925) -> PASS +1

    igt@kms_setmode@basic:
      shard-apl:          FAIL (fdo#99912) -> PASS

    igt@kms_universal_plane@universal-plane-pipe-c-functional:
      shard-glk:          FAIL (fdo#103166) -> PASS +4

    
    ==== Warnings ====

    igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
      shard-glk:          DMESG-WARN (fdo#107956) -> INCOMPLETE (k.org#198133, fdo#103359)

    igt@kms_cursor_crc@cursor-256x256-sliding:
      shard-apl:          FAIL (fdo#103232) -> DMESG-WARN (fdo#105602, fdo#103558)

    igt@kms_cursor_crc@cursor-64x64-suspend:
      shard-apl:          FAIL (fdo#103232, fdo#103191) -> INCOMPLETE (fdo#103927)

    
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
  fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
  fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#104782 https://bugs.freedesktop.org/show_bug.cgi?id=104782
  fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
  fdo#105458 https://bugs.freedesktop.org/show_bug.cgi?id=105458
  fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
  fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
  fdo#106510 https://bugs.freedesktop.org/show_bug.cgi?id=106510
  fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538
  fdo#107749 https://bugs.freedesktop.org/show_bug.cgi?id=107749
  fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
  fdo#108131 https://bugs.freedesktop.org/show_bug.cgi?id=108131
  fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
  fdo#108147 https://bugs.freedesktop.org/show_bug.cgi?id=108147
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
  k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133


== Participating hosts (6 -> 5) ==

  Missing    (1): shard-skl 


== Build changes ==

    * IGT: IGT_4670 -> IGTPW_1925
    * Linux: CI_DRM_4933 -> CI_DRM_4944

  CI_DRM_4933: 6b7a44d1597791524f46d7ea17620db54dffdc8c @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4944: 66bd263b99fd264b57432c232756baf95b0a6255 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1925: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1925/
  IGT_4670: 7e066794d2ea860f4199fd67549080de17b6b852 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1925/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 1/1] tests/tools_test: Find the tool binaries also from bindir
  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
                   ` (2 preceding siblings ...)
  2018-10-08 15:49 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2018-11-05 10:50 ` Arkadiusz Hiler
  2018-11-05 11:42   ` Petri Latvala
  3 siblings, 1 reply; 7+ messages in thread
From: Arkadiusz Hiler @ 2018-11-05 10:50 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

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

> +}
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 1/1] tests/tools_test: Find the tool binaries also from bindir
  2018-11-05 10:50 ` [igt-dev] [PATCH i-g-t 1/1] " Arkadiusz Hiler
@ 2018-11-05 11:42   ` Petri Latvala
  2018-11-05 13:45     ` Arkadiusz Hiler
  0 siblings, 1 reply; 7+ messages in thread
From: Petri Latvala @ 2018-11-05 11:42 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: igt-dev

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 1/1] tests/tools_test: Find the tool binaries also from bindir
  2018-11-05 11:42   ` Petri Latvala
@ 2018-11-05 13:45     ` Arkadiusz Hiler
  0 siblings, 0 replies; 7+ messages in thread
From: Arkadiusz Hiler @ 2018-11-05 13:45 UTC (permalink / raw)
  To: igt-dev

On Mon, Nov 05, 2018 at 01:42:52PM +0200, Petri Latvala wrote:
> 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.

right

Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-11-05 13:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2018-11-05 13:45     ` Arkadiusz Hiler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.