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 <[email protected]> > --- > > 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.
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
