Re: [Intel-gfx] [PATCH i-g-t v3] lib/igt_core.c: Expand --run-subtest functionality.

2016-02-18 Thread Morton, Derek J
>
>
>-Original Message-
>From: Daniel Vetter [mailto:daniel.vet...@ffwll.ch] On Behalf Of Daniel Vetter
>Sent: Wednesday, February 17, 2016 11:10 PM
>To: Morton, Derek J 
>Cc: intel-gfx@lists.freedesktop.org; Gore, Tim ; Gordon, 
>David S ; david.weineh...@linux.intel.com; 
>ville.syrj...@linux.intel.com; daniel.vet...@ffwll.ch
>Subject: Re: [PATCH i-g-t v3] lib/igt_core.c: Expand --run-subtest 
>functionality.
>
>On Wed, Feb 17, 2016 at 06:18:21PM +0100, Daniel Vetter wrote:
>> On Thu, Feb 04, 2016 at 12:06:57PM +, Derek Morton wrote:
>> > Added extended wildcard support when specifying --run-subtest.
>> > 
>> > Wildcard format is as specified in rfc3977 and the uwildmat() 
>> > implementation is taken from libinn.
>> > See https://tools.ietf.org/html/rfc3977#section-4 for a description 
>> > of allowed wildcard expressions.
>> > 
>> > v2: Use comma as list separator (Ville Syrjala) support both ^ and ! 
>> > as not operators (Dave Gordon)
>> > 
>> > v3: Updated to use uwildmat() (Dave Gordon)
>> > 
>> > Signed-off-by: Derek Morton 
>> 
>> So really not happy that we perpetuate the interface differences in 
>> how igt is run between android and linux. But oh well, maybe this 
>> helps in getting the android team more on board with upstream igt 
>> tests than also reinventing those wheels.
>> 
>> Applied, thanks for the patch.
>
>Ok, this breaks the normal partial match functionality, which is pretty handy 
>for running a few tests. New we need *foo* instead of foo. Can you pls add a 
>patch on top to restore that?

HI Daniel,

Do you know when this partial match functionality was added? I have tried with 
the commit adding my patch, and the prior commit (e.g without my patch) and the 
behaviour I see is the same.
./gem_basic --run-subtest fd fails
./gem_basic --run-subtest '*fd*' runs create-fd-close

I also went back to:
commit 982934625ac67234c6d85c6cf29a5a487e54d4f0
lib: allow wildcard matching when specifying subtests

That also has the same behaviour.

The commit prior to that fails both cases as there is no wildcard support.

I did all my testing on Android so if you see something different on Linux 
perhaps there is a difference in the fnmatch() implementation between Linux and 
android?

I can create a patch to add this partial match functionality as well as the 
wildcard match if you want. It should be a simple case of calling strstr() if 
the wildcard match fails.

//Derek


>
>Thanks, Daniel
>
>> -Daniel
>> 
>> > ---
>> >  COPYING |  21 +++
>> >  lib/Makefile.sources|   2 +
>> >  lib/igt_core.c  |  17 +-
>> >  lib/uwildmat/uwildmat.c | 474 
>> > 
>> >  lib/uwildmat/uwildmat.h |  24 +++
>> >  5 files changed, 536 insertions(+), 2 deletions(-)  create mode 
>> > 100644 lib/uwildmat/uwildmat.c  create mode 100644 
>> > lib/uwildmat/uwildmat.h
>> > 
>> > diff --git a/COPYING b/COPYING
>> > index b8f6753..16375f2 100644
>> > --- a/COPYING
>> > +++ b/COPYING
>> > @@ -106,3 +106,24 @@ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 
>> > ANY CLAIM, DAMAGES OR OTHER  LIABILITY, WHETHER IN AN ACTION OF 
>> > CONTRACT, TORT OR OTHERWISE, ARISING  FROM, OUT OF OR IN CONNECTION 
>> > WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS  IN THE SOFTWARE.
>> > +
>> > +Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
>> > +2013, 2014 by Internet Systems Consortium, Inc. ("ISC") 
>> > +Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
>> > +2002, 2003 by The Internet Software Consortium and Rich Salz
>> > +
>> > +This code is derived from software contributed to the Internet 
>> > +Software Consortium by Rich Salz.
>> > +
>> > +Permission to use, copy, modify, and distribute this software for 
>> > +any purpose with or without fee is hereby granted, provided that 
>> > +the above copyright notice and this permission notice appear in all 
>> > copies.
>> > +
>> > +THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES 
>> > +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 
>> > +MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR 
>> > +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY 
>> > +DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
>> > +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 
>> > +ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 
>> > THIS SOFTWARE.
>> > +
>> > diff --git a/lib/Makefile.sources b/lib/Makefile.sources index 
>> > 4999868..e33861e 100644
>> > --- a/lib/Makefile.sources
>> > +++ b/lib/Makefile.sources
>> > @@ -60,6 +60,8 @@ libintel_tools_la_SOURCES =  \
>> >igt_core.h  \
>> >igt_draw.c  \
>> >igt_draw.h  \
>> > +  uwildmat/uwildmat.h \
>> > +  uwildmat/uwildmat.c \
>> >$(NULL)
>> >  
>> >  .PHONY: version.h.tmp
>> > diff --git a/lib/igt_core.c b/lib/igt_core.c index 6b69bb7..8e0bd2e 

Re: [Intel-gfx] [PATCH i-g-t v3] lib/igt_core.c: Expand --run-subtest functionality.

2016-02-17 Thread Daniel Vetter
On Wed, Feb 17, 2016 at 06:18:21PM +0100, Daniel Vetter wrote:
> On Thu, Feb 04, 2016 at 12:06:57PM +, Derek Morton wrote:
> > Added extended wildcard support when specifying --run-subtest.
> > 
> > Wildcard format is as specified in rfc3977 and the uwildmat() implementation
> > is taken from libinn.
> > See https://tools.ietf.org/html/rfc3977#section-4 for a description of
> > allowed wildcard expressions.
> > 
> > v2: Use comma as list separator (Ville Syrjala)
> > support both ^ and ! as not operators (Dave Gordon)
> > 
> > v3: Updated to use uwildmat() (Dave Gordon)
> > 
> > Signed-off-by: Derek Morton 
> 
> So really not happy that we perpetuate the interface differences in how
> igt is run between android and linux. But oh well, maybe this helps in
> getting the android team more on board with upstream igt tests than also
> reinventing those wheels.
> 
> Applied, thanks for the patch.

Ok, this breaks the normal partial match functionality, which is pretty
handy for running a few tests. New we need *foo* instead of foo. Can you
pls add a patch on top to restore that?

Thanks, Daniel

> -Daniel
> 
> > ---
> >  COPYING |  21 +++
> >  lib/Makefile.sources|   2 +
> >  lib/igt_core.c  |  17 +-
> >  lib/uwildmat/uwildmat.c | 474 
> > 
> >  lib/uwildmat/uwildmat.h |  24 +++
> >  5 files changed, 536 insertions(+), 2 deletions(-)
> >  create mode 100644 lib/uwildmat/uwildmat.c
> >  create mode 100644 lib/uwildmat/uwildmat.h
> > 
> > diff --git a/COPYING b/COPYING
> > index b8f6753..16375f2 100644
> > --- a/COPYING
> > +++ b/COPYING
> > @@ -106,3 +106,24 @@ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 
> > CLAIM, DAMAGES OR OTHER
> >  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> >  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
> > DEALINGS
> >  IN THE SOFTWARE.
> > +
> > +Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
> > +2013, 2014 by Internet Systems Consortium, Inc. ("ISC")
> > +Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
> > +2002, 2003 by The Internet Software Consortium and Rich Salz
> > +
> > +This code is derived from software contributed to the Internet Software
> > +Consortium by Rich Salz.
> > +
> > +Permission to use, copy, modify, and distribute this software for any
> > +purpose with or without fee is hereby granted, provided that the above
> > +copyright notice and this permission notice appear in all copies.
> > +
> > +THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
> > +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> > +MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY
> > +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> > +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
> > +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
> > +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> > +
> > diff --git a/lib/Makefile.sources b/lib/Makefile.sources
> > index 4999868..e33861e 100644
> > --- a/lib/Makefile.sources
> > +++ b/lib/Makefile.sources
> > @@ -60,6 +60,8 @@ libintel_tools_la_SOURCES =   \
> > igt_core.h  \
> > igt_draw.c  \
> > igt_draw.h  \
> > +   uwildmat/uwildmat.h \
> > +   uwildmat/uwildmat.c \
> > $(NULL)
> >  
> >  .PHONY: version.h.tmp
> > diff --git a/lib/igt_core.c b/lib/igt_core.c
> > index 6b69bb7..8e0bd2e 100644
> > --- a/lib/igt_core.c
> > +++ b/lib/igt_core.c
> > @@ -56,7 +56,7 @@
> >  #include 
> >  #include 
> >  #include 
> > -#include 
> > +#include 
> >  
> >  #include "drmtest.h"
> >  #include "intel_chipset.h"
> > @@ -209,6 +209,19 @@
> >   * intel gpu to be present). Then individual subtests can be run with
> >   * "--run-subtest". Usage help for tests with subtests can be obtained 
> > with the
> >   * "--help" command line option.
> > + *
> > + * A wildcard expression can be given to --run-subtest to specify a subset 
> > of
> > + * subtests to run. See https://tools.ietf.org/html/rfc3977#section-4 for a
> > + * description of allowed wildcard expressions.
> > + * Some examples of allowed wildcard expressions are:
> > + *
> > + * - '*basic*' match any subtest containing basic
> > + * - 'basic-???' match any subtest named basic- with 3 characters after -
> > + * - 'basic-[0-9]' match any subtest named basic- with a single number 
> > after -
> > + * - 'basic-[^0-9]' match any subtest named basic- with a single non 
> > numerical character after -
> > + * - 'basic*,advanced*' match any subtest starting basic or advanced
> > + * - '*,!basic*' match any subtest not starting basic
> > + * - 'basic*,!basic-render*' match any subtest starting basic but not 
> > starting basic-render
> >   */
> >  
> >  static unsigned int exit_handler_count;
> > @@ -814,7 +827,7 @@ bool __igt_run_subtest

Re: [Intel-gfx] [PATCH i-g-t v3] lib/igt_core.c: Expand --run-subtest functionality.

2016-02-17 Thread Daniel Vetter
On Thu, Feb 04, 2016 at 12:06:57PM +, Derek Morton wrote:
> Added extended wildcard support when specifying --run-subtest.
> 
> Wildcard format is as specified in rfc3977 and the uwildmat() implementation
> is taken from libinn.
> See https://tools.ietf.org/html/rfc3977#section-4 for a description of
> allowed wildcard expressions.
> 
> v2: Use comma as list separator (Ville Syrjala)
> support both ^ and ! as not operators (Dave Gordon)
> 
> v3: Updated to use uwildmat() (Dave Gordon)
> 
> Signed-off-by: Derek Morton 

So really not happy that we perpetuate the interface differences in how
igt is run between android and linux. But oh well, maybe this helps in
getting the android team more on board with upstream igt tests than also
reinventing those wheels.

Applied, thanks for the patch.
-Daniel

> ---
>  COPYING |  21 +++
>  lib/Makefile.sources|   2 +
>  lib/igt_core.c  |  17 +-
>  lib/uwildmat/uwildmat.c | 474 
> 
>  lib/uwildmat/uwildmat.h |  24 +++
>  5 files changed, 536 insertions(+), 2 deletions(-)
>  create mode 100644 lib/uwildmat/uwildmat.c
>  create mode 100644 lib/uwildmat/uwildmat.h
> 
> diff --git a/COPYING b/COPYING
> index b8f6753..16375f2 100644
> --- a/COPYING
> +++ b/COPYING
> @@ -106,3 +106,24 @@ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 
> CLAIM, DAMAGES OR OTHER
>  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
>  IN THE SOFTWARE.
> +
> +Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
> +2013, 2014 by Internet Systems Consortium, Inc. ("ISC")
> +Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
> +2002, 2003 by The Internet Software Consortium and Rich Salz
> +
> +This code is derived from software contributed to the Internet Software
> +Consortium by Rich Salz.
> +
> +Permission to use, copy, modify, and distribute this software for any
> +purpose with or without fee is hereby granted, provided that the above
> +copyright notice and this permission notice appear in all copies.
> +
> +THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
> +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> +MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY
> +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
> +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
> +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> +
> diff --git a/lib/Makefile.sources b/lib/Makefile.sources
> index 4999868..e33861e 100644
> --- a/lib/Makefile.sources
> +++ b/lib/Makefile.sources
> @@ -60,6 +60,8 @@ libintel_tools_la_SOURCES = \
>   igt_core.h  \
>   igt_draw.c  \
>   igt_draw.h  \
> + uwildmat/uwildmat.h \
> + uwildmat/uwildmat.c \
>   $(NULL)
>  
>  .PHONY: version.h.tmp
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 6b69bb7..8e0bd2e 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -56,7 +56,7 @@
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
>  
>  #include "drmtest.h"
>  #include "intel_chipset.h"
> @@ -209,6 +209,19 @@
>   * intel gpu to be present). Then individual subtests can be run with
>   * "--run-subtest". Usage help for tests with subtests can be obtained with 
> the
>   * "--help" command line option.
> + *
> + * A wildcard expression can be given to --run-subtest to specify a subset of
> + * subtests to run. See https://tools.ietf.org/html/rfc3977#section-4 for a
> + * description of allowed wildcard expressions.
> + * Some examples of allowed wildcard expressions are:
> + *
> + * - '*basic*' match any subtest containing basic
> + * - 'basic-???' match any subtest named basic- with 3 characters after -
> + * - 'basic-[0-9]' match any subtest named basic- with a single number after 
> -
> + * - 'basic-[^0-9]' match any subtest named basic- with a single non 
> numerical character after -
> + * - 'basic*,advanced*' match any subtest starting basic or advanced
> + * - '*,!basic*' match any subtest not starting basic
> + * - 'basic*,!basic-render*' match any subtest starting basic but not 
> starting basic-render
>   */
>  
>  static unsigned int exit_handler_count;
> @@ -814,7 +827,7 @@ bool __igt_run_subtest(const char *subtest_name)
>   }
>  
>   if (run_single_subtest) {
> - if (fnmatch(run_single_subtest, subtest_name, 0) != 0)
> + if (uwildmat(subtest_name, run_single_subtest) == 0)
>   return false;
>   else
>   run_single_subtest_found = true;
> diff --git a/lib/uwildmat/uwildmat.c b/lib/uwildmat/uwildmat.c
> new file mode 100644
> index 000..2d34742
> --- /dev/null
> +++ b/lib/uwildmat/uwildmat.c

Re: [Intel-gfx] [PATCH i-g-t v3] lib/igt_core.c: Expand --run-subtest functionality.

2016-02-16 Thread Morton, Derek J
>
>
>-Original Message-
>From: Gordon, David S 
>Sent: Monday, February 15, 2016 7:29 PM
>To: Daniel Vetter ; Morton, Derek J 
>Cc: intel-gfx@lists.freedesktop.org; Gore, Tim ; 
>david.weineh...@linux.intel.com; ville.syrj...@linux.intel.com; 
>daniel.vet...@ffwll.ch
>Subject: Re: [PATCH i-g-t v3] lib/igt_core.c: Expand --run-subtest 
>functionality.
>
>On 15/02/16 16:55, Daniel Vetter wrote:
>> On Thu, Feb 04, 2016 at 12:06:57PM +, Derek Morton wrote:
>>> Added extended wildcard support when specifying --run-subtest.
>>>
>>> Wildcard format is as specified in rfc3977 and the uwildmat() 
>>> implementation is taken from libinn.
>>> See https://tools.ietf.org/html/rfc3977#section-4 for a description 
>>> of allowed wildcard expressions.
>>>
>>> v2: Use comma as list separator (Ville Syrjala) support both ^ and ! 
>>> as not operators (Dave Gordon)
>>>
>>> v3: Updated to use uwildmat() (Dave Gordon)
>>>
>>> Signed-off-by: Derek Morton 
>>> ---
>>>   COPYING |  21 +++
>>>   lib/Makefile.sources|   2 +
>>>   lib/igt_core.c  |  17 +-
>>>   lib/uwildmat/uwildmat.c | 474 
>>> 
>>>   lib/uwildmat/uwildmat.h |  24 +++
>>
>> Not really a fan of copying other sources into ours. Don't we have 
>> something ready-made that's generally available, or can we at least 
>> pull it in as a build-dep?
>>
>> Thanks, Daniel
>
>It's a standard, RFC3977. The source is readily available for download, for 
>example from the INN master site
>
>https://inn.eyrie.org/trac/browser/trunk/lib/uwildmat.c
>
>It seems to be very stable (last change was 2014: "Change Russ' email 
>address").
>
>It *is* already available (in Ubuntu at least), but it's in a fairly obscure 
>package that not many people will have installed. On Ubuntu, 
>/usr/lib/news/libinn.a is part of package 'inn2-dev'; I understand that on 
>some other distros its in a different package (e.g. 'inn-devel' on CentOS).
>
>So this is probably why Derek chose to include the source from INN rather than 
>working out how to make it a prerequisite for building i-g-t. And it almost 
>certainly isn't otherwise available for Android!

It is not available in android by default and it seemed excessive to require 
anyone who wanted to use IGT to have to compile and install the internet news 
package just to pick up this file so I added the file in the patch.

The only 'simple' alternative I can see would be to introduce a new command 
line parameter 'run-subtest-regex' To allow regular expressions to be used, but 
using regular expressions to specify 'run all subtests except...' is not 
particularly pretty and the uwildmat solution is better in my opinion for 
expressing a subset of tests to run.

//Derek

>
>.Dave.
>
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH i-g-t v3] lib/igt_core.c: Expand --run-subtest functionality.

2016-02-15 Thread Dave Gordon

On 15/02/16 16:55, Daniel Vetter wrote:

On Thu, Feb 04, 2016 at 12:06:57PM +, Derek Morton wrote:

Added extended wildcard support when specifying --run-subtest.

Wildcard format is as specified in rfc3977 and the uwildmat() implementation
is taken from libinn.
See https://tools.ietf.org/html/rfc3977#section-4 for a description of
allowed wildcard expressions.

v2: Use comma as list separator (Ville Syrjala)
support both ^ and ! as not operators (Dave Gordon)

v3: Updated to use uwildmat() (Dave Gordon)

Signed-off-by: Derek Morton 
---
  COPYING |  21 +++
  lib/Makefile.sources|   2 +
  lib/igt_core.c  |  17 +-
  lib/uwildmat/uwildmat.c | 474 
  lib/uwildmat/uwildmat.h |  24 +++


Not really a fan of copying other sources into ours. Don't we have
something ready-made that's generally available, or can we at least pull
it in as a build-dep?

Thanks, Daniel


It's a standard, RFC3977. The source is readily available for download, 
for example from the INN master site


https://inn.eyrie.org/trac/browser/trunk/lib/uwildmat.c

It seems to be very stable (last change was 2014: "Change Russ' email 
address").


It *is* already available (in Ubuntu at least), but it's in a fairly 
obscure package that not many people will have installed. On Ubuntu, 
/usr/lib/news/libinn.a is part of package 'inn2-dev'; I understand that 
on some other distros its in a different package (e.g. 'inn-devel' on 
CentOS).


So this is probably why Derek chose to include the source from INN 
rather than working out how to make it a prerequisite for building 
i-g-t. And it almost certainly isn't otherwise available for Android!


.Dave.
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH i-g-t v3] lib/igt_core.c: Expand --run-subtest functionality.

2016-02-15 Thread Daniel Vetter
On Thu, Feb 04, 2016 at 12:06:57PM +, Derek Morton wrote:
> Added extended wildcard support when specifying --run-subtest.
> 
> Wildcard format is as specified in rfc3977 and the uwildmat() implementation
> is taken from libinn.
> See https://tools.ietf.org/html/rfc3977#section-4 for a description of
> allowed wildcard expressions.
> 
> v2: Use comma as list separator (Ville Syrjala)
> support both ^ and ! as not operators (Dave Gordon)
> 
> v3: Updated to use uwildmat() (Dave Gordon)
> 
> Signed-off-by: Derek Morton 
> ---
>  COPYING |  21 +++
>  lib/Makefile.sources|   2 +
>  lib/igt_core.c  |  17 +-
>  lib/uwildmat/uwildmat.c | 474 
> 
>  lib/uwildmat/uwildmat.h |  24 +++

Not really a fan of copying other sources into ours. Don't we have
something ready-made that's generally available, or can we at least pull
it in as a build-dep?

Thanks, Daniel

>  5 files changed, 536 insertions(+), 2 deletions(-)
>  create mode 100644 lib/uwildmat/uwildmat.c
>  create mode 100644 lib/uwildmat/uwildmat.h
> 
> diff --git a/COPYING b/COPYING
> index b8f6753..16375f2 100644
> --- a/COPYING
> +++ b/COPYING
> @@ -106,3 +106,24 @@ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 
> CLAIM, DAMAGES OR OTHER
>  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
>  IN THE SOFTWARE.
> +
> +Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
> +2013, 2014 by Internet Systems Consortium, Inc. ("ISC")
> +Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
> +2002, 2003 by The Internet Software Consortium and Rich Salz
> +
> +This code is derived from software contributed to the Internet Software
> +Consortium by Rich Salz.
> +
> +Permission to use, copy, modify, and distribute this software for any
> +purpose with or without fee is hereby granted, provided that the above
> +copyright notice and this permission notice appear in all copies.
> +
> +THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
> +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> +MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY
> +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
> +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
> +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> +
> diff --git a/lib/Makefile.sources b/lib/Makefile.sources
> index 4999868..e33861e 100644
> --- a/lib/Makefile.sources
> +++ b/lib/Makefile.sources
> @@ -60,6 +60,8 @@ libintel_tools_la_SOURCES = \
>   igt_core.h  \
>   igt_draw.c  \
>   igt_draw.h  \
> + uwildmat/uwildmat.h \
> + uwildmat/uwildmat.c \
>   $(NULL)
>  
>  .PHONY: version.h.tmp
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 6b69bb7..8e0bd2e 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -56,7 +56,7 @@
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
>  
>  #include "drmtest.h"
>  #include "intel_chipset.h"
> @@ -209,6 +209,19 @@
>   * intel gpu to be present). Then individual subtests can be run with
>   * "--run-subtest". Usage help for tests with subtests can be obtained with 
> the
>   * "--help" command line option.
> + *
> + * A wildcard expression can be given to --run-subtest to specify a subset of
> + * subtests to run. See https://tools.ietf.org/html/rfc3977#section-4 for a
> + * description of allowed wildcard expressions.
> + * Some examples of allowed wildcard expressions are:
> + *
> + * - '*basic*' match any subtest containing basic
> + * - 'basic-???' match any subtest named basic- with 3 characters after -
> + * - 'basic-[0-9]' match any subtest named basic- with a single number after 
> -
> + * - 'basic-[^0-9]' match any subtest named basic- with a single non 
> numerical character after -
> + * - 'basic*,advanced*' match any subtest starting basic or advanced
> + * - '*,!basic*' match any subtest not starting basic
> + * - 'basic*,!basic-render*' match any subtest starting basic but not 
> starting basic-render
>   */
>  
>  static unsigned int exit_handler_count;
> @@ -814,7 +827,7 @@ bool __igt_run_subtest(const char *subtest_name)
>   }
>  
>   if (run_single_subtest) {
> - if (fnmatch(run_single_subtest, subtest_name, 0) != 0)
> + if (uwildmat(subtest_name, run_single_subtest) == 0)
>   return false;
>   else
>   run_single_subtest_found = true;
> diff --git a/lib/uwildmat/uwildmat.c b/lib/uwildmat/uwildmat.c
> new file mode 100644
> index 000..2d34742
> --- /dev/null
> +++ b/lib/uwildmat/uwildmat.c
> @@ -0,0 +1,474 @@
> +/* uwildmat.c is reused from libinn - 
> https://launchpad.net/ubuntu/+source/inn

Re: [Intel-gfx] [PATCH i-g-t v3] lib/igt_core.c: Expand --run-subtest functionality.

2016-02-09 Thread Dave Gordon

On 04/02/16 12:06, Derek Morton wrote:

Added extended wildcard support when specifying --run-subtest.

Wildcard format is as specified in rfc3977 and the uwildmat() implementation
is taken from libinn.
See https://tools.ietf.org/html/rfc3977#section-4 for a description of
allowed wildcard expressions.

v2: Use comma as list separator (Ville Syrjala)
support both ^ and ! as not operators (Dave Gordon)

v3: Updated to use uwildmat() (Dave Gordon)

Signed-off-by: Derek Morton 
---
  COPYING |  21 +++
  lib/Makefile.sources|   2 +
  lib/igt_core.c  |  17 +-
  lib/uwildmat/uwildmat.c | 474 
  lib/uwildmat/uwildmat.h |  24 +++
  5 files changed, 536 insertions(+), 2 deletions(-)
  create mode 100644 lib/uwildmat/uwildmat.c
  create mode 100644 lib/uwildmat/uwildmat.h


LGTM.

Reviewed-by: Dave Gordon 

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t v3] lib/igt_core.c: Expand --run-subtest functionality.

2016-02-04 Thread Derek Morton
Added extended wildcard support when specifying --run-subtest.

Wildcard format is as specified in rfc3977 and the uwildmat() implementation
is taken from libinn.
See https://tools.ietf.org/html/rfc3977#section-4 for a description of
allowed wildcard expressions.

v2: Use comma as list separator (Ville Syrjala)
support both ^ and ! as not operators (Dave Gordon)

v3: Updated to use uwildmat() (Dave Gordon)

Signed-off-by: Derek Morton 
---
 COPYING |  21 +++
 lib/Makefile.sources|   2 +
 lib/igt_core.c  |  17 +-
 lib/uwildmat/uwildmat.c | 474 
 lib/uwildmat/uwildmat.h |  24 +++
 5 files changed, 536 insertions(+), 2 deletions(-)
 create mode 100644 lib/uwildmat/uwildmat.c
 create mode 100644 lib/uwildmat/uwildmat.h

diff --git a/COPYING b/COPYING
index b8f6753..16375f2 100644
--- a/COPYING
+++ b/COPYING
@@ -106,3 +106,24 @@ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 IN THE SOFTWARE.
+
+Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
+2013, 2014 by Internet Systems Consortium, Inc. ("ISC")
+Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003 by The Internet Software Consortium and Rich Salz
+
+This code is derived from software contributed to the Internet Software
+Consortium by Rich Salz.
+
+Permission to use, copy, modify, and distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY
+SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
diff --git a/lib/Makefile.sources b/lib/Makefile.sources
index 4999868..e33861e 100644
--- a/lib/Makefile.sources
+++ b/lib/Makefile.sources
@@ -60,6 +60,8 @@ libintel_tools_la_SOURCES =   \
igt_core.h  \
igt_draw.c  \
igt_draw.h  \
+   uwildmat/uwildmat.h \
+   uwildmat/uwildmat.c \
$(NULL)
 
 .PHONY: version.h.tmp
diff --git a/lib/igt_core.c b/lib/igt_core.c
index 6b69bb7..8e0bd2e 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -56,7 +56,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include "drmtest.h"
 #include "intel_chipset.h"
@@ -209,6 +209,19 @@
  * intel gpu to be present). Then individual subtests can be run with
  * "--run-subtest". Usage help for tests with subtests can be obtained with the
  * "--help" command line option.
+ *
+ * A wildcard expression can be given to --run-subtest to specify a subset of
+ * subtests to run. See https://tools.ietf.org/html/rfc3977#section-4 for a
+ * description of allowed wildcard expressions.
+ * Some examples of allowed wildcard expressions are:
+ *
+ * - '*basic*' match any subtest containing basic
+ * - 'basic-???' match any subtest named basic- with 3 characters after -
+ * - 'basic-[0-9]' match any subtest named basic- with a single number after -
+ * - 'basic-[^0-9]' match any subtest named basic- with a single non numerical 
character after -
+ * - 'basic*,advanced*' match any subtest starting basic or advanced
+ * - '*,!basic*' match any subtest not starting basic
+ * - 'basic*,!basic-render*' match any subtest starting basic but not starting 
basic-render
  */
 
 static unsigned int exit_handler_count;
@@ -814,7 +827,7 @@ bool __igt_run_subtest(const char *subtest_name)
}
 
if (run_single_subtest) {
-   if (fnmatch(run_single_subtest, subtest_name, 0) != 0)
+   if (uwildmat(subtest_name, run_single_subtest) == 0)
return false;
else
run_single_subtest_found = true;
diff --git a/lib/uwildmat/uwildmat.c b/lib/uwildmat/uwildmat.c
new file mode 100644
index 000..2d34742
--- /dev/null
+++ b/lib/uwildmat/uwildmat.c
@@ -0,0 +1,474 @@
+/* uwildmat.c is reused from libinn - 
https://launchpad.net/ubuntu/+source/inn2/2.5.4-1
+
+This provides wild card matching originally used in InterNetNews and is
+described in https://tools.ietf.org/html/rfc3977#section-4
+
+INN licence:
+INN as a whole and all code contained in it not otherwise marked with
+different licenses and/or copyrights is covered by the following copyright
+and license:
+
+   Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
+   2013, 2014 by Internet Systems Consortium, Inc. ("ISC")
+   Cop