[igt-dev] [PATCH v2] runner: add --list-all and --blacklist

Petri Latvala petri.latvala at intel.com
Mon Jun 17 12:41:05 UTC 2019


On Mon, Jun 17, 2019 at 02:49:37PM +0300, Oleg Vasilev wrote:
> Currently, runner already collects all subtest names into job_list.
> --list-all allows to output it to stdout.
> 
> --blacklist option takes a filename as an argument and adds all regexes
> from that file to the exclusion list.
> 
> v2:
>  - Update exclude/include regex matches for tests without
> 	subtests to be matched with pigtit-like name (Petri)
>  - Replace relative paths with those formatted with testdatadir (Petri)
>  - Minor codestyle changes
> 
> Cc: Petri Latvala <petri.latvala at intel.com>
> Signed-off-by: Oleg Vasilev <oleg.vasilev at intel.com>
> ---
>  runner/job_list.c                   |  27 ++++++-
>  runner/job_list.h                   |   1 +
>  runner/runner.c                     |   5 ++
>  runner/runner_tests.c               |  18 ++++-
>  runner/settings.c                   | 117 +++++++++++++++++++++++-----
>  runner/settings.h                   |   1 +
>  runner/testdata/meson.build         |   5 ++
>  runner/testdata/test-blacklist.txt  |   2 +
>  runner/testdata/test-blacklist2.txt |   2 +
>  9 files changed, 154 insertions(+), 24 deletions(-)
>  create mode 100644 runner/testdata/test-blacklist.txt
>  create mode 100644 runner/testdata/test-blacklist2.txt
> 
> diff --git a/runner/job_list.c b/runner/job_list.c
> index 4a16742f..e78e0358 100644
> --- a/runner/job_list.c
> +++ b/runner/job_list.c
> @@ -111,11 +111,16 @@ static void add_subtests(struct job_list *job_list, struct settings *settings,
>  		fprintf(stderr, "popen error when executing %s: %s\n", binary, strerror(errno));
>  	} else if (WIFEXITED(s)) {
>  		if (WEXITSTATUS(s) == IGT_EXIT_INVALID) {
> +			char piglitname[256];
> +			generate_piglit_name(binary, NULL,
> +					     piglitname, sizeof(piglitname));
> +
>  			/* No subtests on this one */
> -			if (exclude && exclude->size && matches_any(binary, exclude)) {
> +			if (exclude && exclude->size &&
> +					matches_any(piglitname, exclude)) {
>  				return;
>  			}
> -			if (!include || !include->size || matches_any(binary, include)) {
> +			if (!include || !include->size || matches_any(piglitname, include)) {
>  				add_job_list_entry(job_list, strdup(binary), NULL, 0);
>  				return;
>  			}


Well that makes sense!



> @@ -291,6 +296,24 @@ static bool job_list_from_test_list(struct job_list *job_list,
>  	return any;
>  }
>  
> +void list_all_tests(struct job_list* lst)
> +{
> +	for (size_t test_idx = 0; test_idx < lst->size; ++test_idx){
> +		struct job_list_entry* current_entry = lst->entries+test_idx;
> +		if (current_entry->subtest_count==0) {
> +			printf("igt@%s\n", current_entry->binary);
> +			continue;
> +		}
> +		for (size_t subtest_idx = 0;
> +		    subtest_idx < current_entry->subtest_count;
> +		    ++subtest_idx) {
> +			char *subtest_name = current_entry->subtests[subtest_idx];
> +			printf("igt@%s@%s\n", current_entry->binary, subtest_name);
> +		}


Print that in lowercase like piglit does.


Oh, and you need to disable multiple-mode if list-all is
set. Otherwise -t kms -L will print wrong things. Can be left for
later though...

With those changes (multiple-mode change optional at this point),

Reviewed-by: Petri Latvala <petri.latvala at intel.com>


More information about the igt-dev mailing list