[Piglit] [PATCH 06/10] igt.py: Use grouptools

Dylan Baker baker.dylan.c at gmail.com
Fri Dec 5 11:27:05 PST 2014


On Friday, December 05, 2014 09:46:57 AM Thomas Wood wrote:
> On 4 December 2014 at 23:10, Dylan Baker <baker.dylan.c at gmail.com> wrote:
> >
> > Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> > ---
> >  tests/igt.py | 17 ++++++-----------
> >  1 file changed, 6 insertions(+), 11 deletions(-)
> >
> > diff --git a/tests/igt.py b/tests/igt.py
> > index 83a99a9..9c08f57 100644
> > --- a/tests/igt.py
> > +++ b/tests/igt.py
> > @@ -26,13 +26,8 @@ import os
> >  import re
> >  import sys
> >  import subprocess
> > -import threading
> > -import time
> > -import signal
> > -import errno
> > -from datetime import datetime
> >
> > -from os import path
> > +import framework.grouptools as grouptools
> >  import framework.core
> >  from framework.profile import TestProfile, Test
> >
> > @@ -88,7 +83,7 @@ class IGTTest(Test):
> >          if arguments is None:
> >              arguments = []
> >          super(IGTTest, self).__init__(
> > -            [path.join(igtTestRoot, binary)] + arguments)
> > +            [os.path.join(igtTestRoot, binary)] + arguments)
> >          self.timeout = 600
> >
> >      def interpret_result(self):
> > @@ -113,7 +108,7 @@ class IGTTest(Test):
> >          super(IGTTest, self).run()
> >
> >  def listTests(listname):
> > -    with open(path.join(igtTestRoot, listname + '.txt'), 'r') as f:
> > +    with open(os.path.join(igtTestRoot, listname + '.txt'), 'r') as f:
> >          lines = (line.rstrip() for line in f.readlines())
> >
> >      found_header = False
> > @@ -134,7 +129,7 @@ tests.extend(listTests("multi-tests"))
> >
> >  def addSubTestCases(test):
> >      proc = subprocess.Popen(
> > -            [path.join(igtTestRoot, test), '--list-subtests'],
> > +            [grouptools.join(igtTestRoot, test), '--list-subtests'],
> 
> This is actually the path to the test binary, so it should be os.path.join().

Doh. I've changed that on my local branch

> 
> 
> >              stdout=subprocess.PIPE,
> >              stderr=subprocess.PIPE,
> >              env=os.environ.copy(),
> > @@ -144,7 +139,7 @@ def addSubTestCases(test):
> >
> >      # a return code of 79 indicates there are no subtests
> >      if proc.returncode == 79:
> > -         profile.test_list[path.join('igt', test)] = IGTTest(test)
> > +         profile.test_list[grouptools.join('igt', test)] = IGTTest(test)
> >           return
> >
> >      if proc.returncode != 0:
> > @@ -156,7 +151,7 @@ def addSubTestCases(test):
> >      for subtest in subtests:
> >          if subtest == "":
> >              continue
> > -        profile.test_list[path.join('igt', test, subtest)] = \
> > +        profile.test_list[grouptools.join('igt', test, subtest)] = \
> >              IGTTest(test, ['--run-subtest', subtest])
> >
> >  for test in tests:
> > --
> > 2.2.0
> >
> > _______________________________________________
> > Piglit mailing list
> > Piglit at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/piglit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20141205/60c7a574/attachment.sig>


More information about the Piglit mailing list