[Piglit] [PATCH] framework/profile: Use re.IGNORECASE for RegexFilter

Kenneth Graunke kenneth at whitecape.org
Sun Nov 20 00:57:12 UTC 2016


On Wednesday, November 16, 2016 11:51:13 AM PST Dylan Baker wrote:
> This flag makes the regular expressions match case-insensitive, and is
> useful since piglit treats test names as case insensitive (lowering them
> all by default). This was inadvertently changed to not use the flag in
> e92555a647, which replaced the part that added this flag with a simpler
> implementation, so this patch reverts to the previous behavior.
> 
> cc: Alejandro PiƱeiro <apinheiro at igalia.com>
> Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> ---
>  framework/profile.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/framework/profile.py b/framework/profile.py
> index 78b3a2d..94efd0a 100644
> --- a/framework/profile.py
> +++ b/framework/profile.py
> @@ -75,7 +75,7 @@ class RegexFilter(object):
>      """
>  
>      def __init__(self, filters, inverse=False):
> -        self.filters = [re.compile(f) for f in filters]
> +        self.filters = [re.compile(f, flags=re.IGNORECASE) for f in filters]
>          self.inverse = inverse
>  
>      def __call__(self, name, _):  # pylint: disable=invalid-name
> 

Given that we already destroy the original case in test names,
this makes sense to me.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20161119/a0051555/attachment.sig>


More information about the Piglit mailing list