Skip to contentSkip to conversation

runner: Make generate_piglit_name non-static

PATCH In review Petri Latvala 3 participants 6 messages Sep 20, 2018 – Sep 21, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 runner: Make generate_piglit_name non-static

and move it to job_list.c

---
 runner/job_list.c  | 37 +++++++++++++++++++++++++++++++++++++
 runner/job_list.h  |  3 +++
 runner/resultgen.c | 36 ------------------------------------
 3 files changed, 40 insertions(+), 36 deletions(-)
runner/job_list.c +37 -0
index 5fe88e4f..88f59b05 100644
@@ -1,3 +1,4 @@
+#include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <linux/limits.h>
@@ -284,6 +285,42 @@ static bool job_list_from_test_list(struct job_list *job_list,
 	return any;
 }
 
+static char *lowercase(const char *str)
+{
+	char *ret = malloc(strlen(str) + 1);
+	char *q = ret;
+
+	while (*str) {
+		if (isspace(*str))
+			break;
+
+		*q++ = tolower(*str++);
+	}
+	*q = '\0';
+
+	return ret;
+}
+
+void generate_piglit_name(const char *binary, const char *subtest,
+			  char *namebuf, size_t namebuf_size)
+{
+	char *lc_binary = lowercase(binary);
+	char *lc_subtest = NULL;
+
+	if (!subtest) {
+		snprintf(namebuf, namebuf_size, "igt@%s", lc_binary);
+		free(lc_binary);
+		return;
+	}
+
+	lc_subtest = lowercase(subtest);
+
+	snprintf(namebuf, namebuf_size, "igt@%s@%s", lc_binary, lc_subtest);
+
+	free(lc_binary);
+	free(lc_subtest);
+}
+
 void init_job_list(struct job_list *job_list)
 {
 	memset(job_list, 0, sizeof(*job_list));
runner/job_list.h +3 -0
index c726ab09..f8bbbddc 100644
@@ -27,6 +27,9 @@ struct job_list
 	size_t size;
 };
 
+void generate_piglit_name(const char *binary, const char *subtest,
+			  char *namebuf, size_t namebuf_size);
+
 void init_job_list(struct job_list *job_list);
 void free_job_list(struct job_list *job_list);
 bool create_job_list(struct job_list *job_list, struct settings *settings);
runner/resultgen.c +0 -36
index d939583d..d34b52db 100644
@@ -148,22 +148,6 @@ static size_t count_lines(const char *buf, const char *bufend)
 	return ret;
 }
 
-static char *lowercase(const char *str)
-{
-	char *ret = malloc(strlen(str) + 1);
-	char *q = ret;
-
-	while (*str) {
-		if (isspace(*str))
-			break;
-
-		*q++ = tolower(*str++);
-	}
-	*q = '\0';
-
-	return ret;
-}
-
 static void append_line(char **buf, size_t *buflen, char *line)
 {
 	size_t linelen = strlen(line);
@@ -173,26 +157,6 @@ static void append_line(char **buf, size_t *buflen, char *line)
 	*buflen += linelen;
 }
 
-static void generate_piglit_name(const char *binary, const char *subtest,
-				 char *namebuf, size_t namebuf_size)
-{
-	char *lc_binary = lowercase(binary);
-	char *lc_subtest = NULL;
-
-	if (!subtest) {
-		snprintf(namebuf, namebuf_size, "igt@%s", lc_binary);
-		free(lc_binary);
-		return;
-	}
-
-	lc_subtest = lowercase(subtest);
-
-	snprintf(namebuf, namebuf_size, "igt@%s@%s", lc_binary, lc_subtest);
-
-	free(lc_binary);
-	free(lc_subtest);
-}
-
 static const struct {
 	const char *output_str;
 	const char *result_str;
Signature · 6 lines
2.18.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

PATCH 2/3 runner: Lowercase the name used for matching -t and -x

And thus make it possible to run -t basic-s3 for example.

---
 runner/job_list.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
runner/job_list.c +2 -5
index 88f59b05..9cf19c45 100644
@@ -75,19 +75,17 @@ static void add_subtests(struct job_list *job_list, struct settings *settings,
 	}
 
 	while (fscanf(p, "%ms", &subtestname) == 1) {
-		char *piglitname;
+		char piglitname[256];
 
-		asprintf(&piglitname, "igt@%s@%s", binary, subtestname);
+		generate_piglit_name(binary, subtestname, piglitname, sizeof(piglitname));
 
 		if (exclude && exclude->size && matches_any(piglitname, exclude)) {
 			free(subtestname);
-			free(piglitname);
 			continue;
 		}
 
 		if (include && include->size && !matches_any(piglitname, include)) {
 			free(subtestname);
-			free(piglitname);
 			continue;
 		}
 
@@ -103,7 +101,6 @@ static void add_subtests(struct job_list *job_list, struct settings *settings,
 		}
 
 		free(subtestname);
-		free(piglitname);
 	}
 
 	if (num_subtests)
Signature · 6 lines
2.18.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#2 lore raw

PATCH 3/3 runner: Support -t and -x with a --test-list

In reply to Petri Latvala

Actually implement what was already commented to work.

---
 runner/job_list.c     |  6 ++++++
 runner/runner_tests.c | 20 ++++++++++++++++++++
 2 files changed, 26 insertions(+)
runner/job_list.c +6 -0
index 9cf19c45..97bbb0be 100644
@@ -211,6 +211,12 @@ static bool job_list_from_test_list(struct job_list *job_list,
 		if ((delim = strchr(line, '#')) != NULL)
 			*delim = '\0';
 
+		if (settings->exclude_regexes.size && matches_any(line, &settings->exclude_regexes))
+			continue;
+
+		if (settings->include_regexes.size && !matches_any(line, &settings->include_regexes))
+			continue;
+
 		if (sscanf(line, "igt@%ms", &binary) == 1) {
 			if ((delim = strchr(binary, '@')) != NULL)
 				*delim++ = '\0';
runner/runner_tests.c +20 -0
index 1a95a75a..b03f2acf 100644
@@ -562,6 +562,26 @@ igt_main
 				igt_assert_eqstr(list.entries[0].subtests[0], "first-subtest");
 				igt_assert_eqstr(list.entries[multiple ? 0 : 1].subtests[multiple ? 1 : 0], "second-subtest");
 			}
+
+			igt_subtest_f("job-list-testlist-filtered-%s", multiple ? "multiple" : "normal") {
+				char *argv[] = { "runner",
+						 "--test-list", filename,
+						 multiple ? "--multiple-mode" : "--sync",
+						 "-t", "successtest",
+						 "-x", "first",
+						 testdatadir,
+						 "path-to-results",
+				};
+
+				igt_assert(parse_options(ARRAY_SIZE(argv), argv, &settings));
+				igt_assert(create_job_list(&list, &settings));
+
+				igt_assert_eq(list.size, 1);
+				igt_assert_eqstr(list.entries[0].binary, "successtest");
+
+				igt_assert_eq(list.entries[0].subtest_count, 1);
+				igt_assert_eqstr(list.entries[0].subtests[0], "second-subtest");
+			}
 		}
 
 		igt_fixture {
Signature · 6 lines
2.18.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#3 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] runner: Make generate_piglit_name non-static

In reply to Petri Latvala
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/3] runner: Make generate_piglit_name non-static
URL : https://patchwork.freedesktop.org/series/49958/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4844 -> IGTPW_1860 =

== Summary - SUCCESS ==

No regressions found.

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

== Known issues ==

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

=== IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_suspend@basic-s3:
      fi-bdw-samus:       PASS -> INCOMPLETE (fdo#107773)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-byt-clapper:     PASS -> FAIL (fdo#103191, fdo#107362)
      fi-blb-e6850:       PASS -> INCOMPLETE (fdo#107718)

    
    ==== Possible fixes ====

    igt@drv_module_reload@basic-reload:
      fi-glk-j4005:       DMESG-WARN (fdo#106248, fdo#106725) -> PASS

    igt@gem_exec_suspend@basic-s4-devices:
      fi-kbl-7500u:       DMESG-WARN (fdo#107139, fdo#105128) -> PASS

    igt@kms_flip@basic-flip-vs-dpms:
      fi-skl-6700hq:      DMESG-WARN (fdo#105998) -> PASS

    igt@kms_flip@basic-flip-vs-modeset:
      fi-glk-j4005:       DMESG-WARN (fdo#106000) -> PASS

    igt@kms_psr@primary_mmap_gtt:
      fi-cnl-u:           FAIL (fdo#107383) -> PASS +2

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

fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#105128 https://bugs.freedesktop.org/show_bug.cgi?id=105128
fdo#105998 https://bugs.freedesktop.org/show_bug.cgi?id=105998
fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000
fdo#106248 https://bugs.freedesktop.org/show_bug.cgi?id=106248
fdo#106725 https://bugs.freedesktop.org/show_bug.cgi?id=106725
fdo#107139 https://bugs.freedesktop.org/show_bug.cgi?id=107139
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
fdo#107383 https://bugs.freedesktop.org/show_bug.cgi?id=107383
fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718
fdo#107726 https://bugs.freedesktop.org/show_bug.cgi?id=107726
fdo#107773 https://bugs.freedesktop.org/show_bug.cgi?id=107773

== Participating hosts (52 -> 46) ==

Additional (2): fi-skl-caroline fi-gdg-551
Missing (8): fi-ilk-m540 fi-hsw-4200u fi-byt-j1900 fi-byt-squawks fi-bsw-cyan fi-snb-2520m fi-ctg-p8600 fi-icl-u

== Build changes ==

* IGT: IGT_4646 -> IGTPW_1860

CI_DRM_4844: 73c0da2189956c18a0fff343bd84eb0493f81db1 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1860: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1860/
IGT_4646: d409cc6f234fbc0122c64be27ba85b5603658de5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

#4 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/3] runner: Make generate_piglit_name non-static

In reply to Petri Latvala
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/3] runner: Make generate_piglit_name non-static
URL : https://patchwork.freedesktop.org/series/49958/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4646_full -> IGTPW_1860_full =

== Summary - SUCCESS ==

No regressions found.

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

== Known issues ==

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

=== IGT changes ===

    ==== Issues hit ====

    igt@gem_ppgtt@blt-vs-render-ctx0:
      shard-kbl:          PASS -> INCOMPLETE (fdo#106023, fdo#103665)

    igt@gem_userptr_blits@readonly-unsync:
      shard-glk:          PASS -> INCOMPLETE (fdo#103359, k.org#198133)

    igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-b:
      shard-glk:          PASS -> DMESG-WARN (fdo#107956)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665)

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

    
    ==== Possible fixes ====

    igt@drv_selftest@live_contexts:
      shard-glk:          DMESG-FAIL (fdo#107979) -> PASS

    igt@gem_userptr_blits@readonly-pwrite-unsync:
      shard-glk:          DMESG-WARN (fdo#106538, fdo#105763) -> PASS +1

    igt@kms_chv_cursor_fail@pipe-a-64x64-bottom-edge:
      shard-glk:          FAIL (fdo#104671) -> PASS

    igt@kms_draw_crc@draw-method-xrgb2101010-mmap-gtt-xtiled:
      shard-glk:          FAIL (fdo#103184) -> PASS

    igt@kms_flip@2x-plain-flip-ts-check-interruptible:
      shard-glk:          FAIL (fdo#100368) -> PASS

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

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

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

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103184 https://bugs.freedesktop.org/show_bug.cgi?id=103184
fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
fdo#104671 https://bugs.freedesktop.org/show_bug.cgi?id=104671
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538
fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
fdo#107979 https://bugs.freedesktop.org/show_bug.cgi?id=107979
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 (5 -> 5) ==

No changes in participating hosts

== Build changes ==

* IGT: IGT_4646 -> IGTPW_1860
* Linux: CI_DRM_4836 -> CI_DRM_4844

CI_DRM_4836: b2b0444aa439ade1ed809a91a19d382fbb5e7700 @ git://anongit.freedesktop.org/gfx-ci/linux
CI_DRM_4844: 73c0da2189956c18a0fff343bd84eb0493f81db1 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1860: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1860/
IGT_4646: d409cc6f234fbc0122c64be27ba85b5603658de5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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