[Piglit] [PATCH] framework/programs/run.py: Allow comments in test-list files.
Dylan Baker
dylan at pnwbakers.com
Mon Oct 17 21:03:38 UTC 2016
Quoting Petri Latvala (2016-10-17 02:52:36)
> IGT testing in Intel's CI is using a static list of tests to
> run. Commenting out tests and annotating them will help
> human-readability.
>
> Signed-off-by: Petri Latvala <petri.latvala at intel.com>
> ---
>
> Possible duplicate, I didn't see this arrive on the mailing list myself
>
> framework/programs/run.py | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/framework/programs/run.py b/framework/programs/run.py
> index ecfc36f..7921816 100644
> --- a/framework/programs/run.py
> +++ b/framework/programs/run.py
> @@ -325,8 +325,9 @@ def run(input_):
> # If a test list is provided then set the forced_test_list value.
> if args.test_list:
> with open(args.test_list) as test_list:
> - # Strip newlines
> - profile.forced_test_list = list([t.strip() for t in test_list])
> + # Strip newlines and comments, ignore empty lines
> + stripped = [t.split('#')[0].strip() for t in test_list]
> + profile.forced_test_list = list(filter(None, stripped))
We don't use map or filter in piglit, we use comprehensions, This also creates a
concrete list for stripped, it would be better to use a generator for that.
I think you could implement this in our style as something like this (I say
think because this isn't tested):
stripped = (t.split('#')[0].strip() for t in test_list)
profile.forced_test_list = [x for x in stripped if x]
Dylan
>
> results.time_elapsed.start = time.time()
> # Set the dmesg type
> --
> 2.9.3
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20161017/995d22d5/attachment.sig>
More information about the Piglit
mailing list