From 19b0c74d20d9b53d4c82be14af0909a3b6846010 Mon Sep 17 00:00:00 2001 From: Petri Latvala Date: Thu, 20 Sep 2018 13:55:07 +0300 Subject: runner: Support -t and -x with a --test-list Actually implement what was already commented to work. Signed-off-by: Petri Latvala Reviewed-by: Arkadiusz Hiler Acked-by: Tomi Sarvela #irc --- runner/job_list.c | 6 ++++++ runner/runner_tests.c | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'runner') 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 { -- cgit v1.2.3