[Piglit] [PATCH] summary: fix support for old results file with duplicated subtests

Dylan Baker baker.dylan.c at gmail.com
Wed May 28 21:19:53 PDT 2014


On Wednesday, May 28, 2014 22:17:55 Ilia Mirkin wrote:
> Old files have duplicated entries for each subtest, in addition to a
> filled subtest dictionary. Detect that the current test name is also a
> subtest and treat it as though it were a complete test. This may have
> false-negatives, but they're unlikely given test/subtest naming
> convention.
> 
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
> 
> Dylan, I'm sure you hate this, but it does seem to work for me. Not sure
> where you are with your fix, but this is a tool that lots of people use, so
> it does need to be addressed. And keep in mind that by now there are 
both
> the "old" and "new" formats running around, so just slapping a version
> number in there won't be enough.
> 
> Perhaps we should add some tests that check against goldens which will 
make
> it more obvious when someone's changing the format.
> 
>  framework/summary.py | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/framework/summary.py b/framework/summary.py
> index c905b98..6eb7535 100644
> --- a/framework/summary.py
> +++ b/framework/summary.py
> @@ -318,8 +318,16 @@ class Summary:
> 
>                  # Treat a test with subtests as if it is a group, assign
> the # subtests' statuses and fractions down to the test, and then -        
>        # proceed like normal.
> -                if 'subtest' in value:
> +                # proceed like normal. However to be compatible with older
> +                # test result files, detect the condition where subtests
> were +                # repeated and treat them as normal tests. Note that
> some +                # subtests actually have paths in them, so 
accomodate
> that as +                # well, up to the second level.
> +                name = path.basename(key)
> +                l2name = path.basename(path.dirname(key))
> +                if ('subtest' in value and
> +                    name not in value['subtest'] and
> +                    os.path.join(l2name, name) not in value['subtest']):
>                      for (subt, subv) in value['subtest'].iteritems():
>                          subt = path.join(key, subt)
>                          subv = so.status_lookup(subv)

My code actually looks a lot like this, but has a little more abstraction

I really feel like this should be able to simplified, but I can't quite figure out 
how to do it. I'll give it my acked-by.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140528/60dff3ba/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140528/60dff3ba/attachment-0001.sig>


More information about the Piglit mailing list