On Friday, January 23, 2015 15:02:01 Thomas Wood wrote:
> On 19 January 2015 at 17:38, Dylan Baker <baker.dyla...@gmail.com> wrote:
> > This uses dict.get() to simplify and streamline the logic.
> > ---
> >  tests/igt.py | 20 +++++++++-----------
> >  1 file changed, 9 insertions(+), 11 deletions(-)
> >
> > diff --git a/tests/igt.py b/tests/igt.py
> > index 55b0f4a..f0064fc 100644
> > --- a/tests/igt.py
> > +++ b/tests/igt.py
> > @@ -61,16 +61,14 @@ def checkEnvironment():
> >      print "Test Environment check: Succeeded."
> >      return True
> >
> > -if 'IGT_TEST_ROOT' in os.environ:
> > -    igtTestRoot = os.environ['IGT_TEST_ROOT']
> > -else:
> > -    igtTestRoot = os.path.join(framework.core.PIGLIT_CONFIG.get('igt', 
> > 'path'),
> > -                               'tests')
> > -    assert os.path.exists(igtTestRoot)
> > +IGT_TEST_ROOT = os.environ.get(
> > +    'IGT_TEST_ROOT',
> > +    os.path.join(framework.core.PIGLIT_CONFIG.get('igt', 'path'), 'tests'))
> 
> PIGLIT_CONFIG.get() is still evaluated even if IGT_TEST_ROOT exists in
> the environment, which means it can't be used to run the tests without
> a configuration file.
> 

I'll drop this patch. I thought that should be covered by the
allow_empty keyword, but apparently not.

> 
> > +assert os.path.exists(IGT_TEST_ROOT)
> >
> >  # check for the test lists
> > -if not (os.path.exists(os.path.join(igtTestRoot, 'single-tests.txt'))
> > -        and os.path.exists(os.path.join(igtTestRoot, 'multi-tests.txt'))):
> > +if not (os.path.exists(os.path.join(IGT_TEST_ROOT, 'single-tests.txt'))
> > +        and os.path.exists(os.path.join(IGT_TEST_ROOT, 
> > 'multi-tests.txt'))):
> >      print "intel-gpu-tools test lists not found."
> >      sys.exit(0)
> >
> > @@ -83,7 +81,7 @@ class IGTTest(Test):
> >          if arguments is None:
> >              arguments = []
> >          super(IGTTest, self).__init__(
> > -            [os.path.join(igtTestRoot, binary)] + arguments)
> > +            [os.path.join(IGT_TEST_ROOT, binary)] + arguments)
> >          self.timeout = 600
> >
> >      def interpret_result(self):
> > @@ -108,7 +106,7 @@ class IGTTest(Test):
> >          super(IGTTest, self).run()
> >
> >  def listTests(listname):
> > -    with open(os.path.join(igtTestRoot, listname + '.txt'), 'r') as f:
> > +    with open(os.path.join(IGT_TEST_ROOT, listname + '.txt'), 'r') as f:
> >          lines = (line.rstrip() for line in f.readlines())
> >
> >      found_header = False
> > @@ -129,7 +127,7 @@ tests.extend(listTests("multi-tests"))
> >
> >  def addSubTestCases(test):
> >      proc = subprocess.Popen(
> > -        [os.path.join(igtTestRoot, test), '--list-subtests'],
> > +        [os.path.join(IGT_TEST_ROOT, test), '--list-subtests'],
> >          stdout=subprocess.PIPE,
> >          stderr=subprocess.PIPE,
> >          env=os.environ.copy(),
> > --
> > 2.2.1
> >
> > _______________________________________________
> > Piglit mailing list
> > Piglit@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/piglit

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to