[igt-dev] [PATCH i-g-t 3/3] runner: Support -t and -x with a --test-list
Petri Latvala
petri.latvala at intel.com
Thu Sep 20 10:55:07 UTC 2018
Actually implement what was already commented to work.
Signed-off-by: Petri Latvala <petri.latvala at intel.com>
---
runner/job_list.c | 6 ++++++
runner/runner_tests.c | 20 ++++++++++++++++++++
2 files changed, 26 insertions(+)
diff --git a/runner/job_list.c b/runner/job_list.c
index 9cf19c45..97bbb0be 100644
--- a/runner/job_list.c
+++ b/runner/job_list.c
@@ -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';
diff --git a/runner/runner_tests.c b/runner/runner_tests.c
index 1a95a75a..b03f2acf 100644
--- a/runner/runner_tests.c
+++ b/runner/runner_tests.c
@@ -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 {
--
2.18.0
More information about the igt-dev
mailing list