[Piglit] [PATCH 1/3] igt: retab

Dylan Baker baker.dylan.c at gmail.com
Tue Nov 12 05:53:35 PST 2013


On Tuesday, November 12, 2013 11:36:31 AM Daniel Vetter wrote:
> I so failed at my python setup when doing this way back (less than a
> year ago).
> ---
>  tests/igt.tests | 66
> ++++++++++++++++++++++++++++----------------------------- 1 file changed,
> 33 insertions(+), 33 deletions(-)
> 
> diff --git a/tests/igt.tests b/tests/igt.tests
> index 1d0da50..e0eb826 100644
> --- a/tests/igt.tests
> +++ b/tests/igt.tests
> @@ -50,16 +50,16 @@ profile = TestProfile()
> 
>  class IGTTest(ExecTest):
>      def __init__(self, binary, arguments=[]):
> -	ExecTest.__init__(self, [path.join(igtTestRoot, binary)] + arguments)
> +        ExecTest.__init__(self, [path.join(igtTestRoot, binary)] +
> arguments)
> 
>      def interpretResult(self, out, returncode, results, dmesg):
> -	if returncode == 0:
> -	    results['result'] = 'dmesg-warn' if dmesg != '' else 'pass'
> -	elif returncode == 77:
> -	    results['result'] = 'skip'
> -	else:
> -	    results['result'] = 'dmesg-fail' if dmesg != '' else 'fail'
> -	return out
> +        if returncode == 0:
> +            results['result'] = 'dmesg-warn' if dmesg != '' else 'pass'
> +        elif returncode == 77:
> +            results['result'] = 'skip'
> +        else:
> +            results['result'] = 'dmesg-fail' if dmesg != '' else 'fail'
> +        return out
>      def run(self, env):
>          env.dmesg = True
>          return ExecTest.run(self, env)
> @@ -67,30 +67,30 @@ class IGTTest(ExecTest):
>  def listTests(listname):
>      oldDir = os.getcwd()
>      try:
> -	os.chdir(igtTestRoot)
> -	proc = subprocess.Popen(
> -		['make', listname ],
> -		stdout=subprocess.PIPE,
> -		stderr=subprocess.PIPE,
> -		env=os.environ.copy(),
> -		universal_newlines=True
> -		)
> -	out, err = proc.communicate()
> -	returncode = proc.returncode
> +        os.chdir(igtTestRoot)
> +        proc = subprocess.Popen(
> +                ['make', listname ],
> +                stdout=subprocess.PIPE,
> +                stderr=subprocess.PIPE,
> +                env=os.environ.copy(),
> +                universal_newlines=True
> +                )
> +        out, err = proc.communicate()
> +        returncode = proc.returncode
>      finally:
> -	os.chdir(oldDir)
> +        os.chdir(oldDir)
> 
>      lines = out.split('\n')
>      found_header = False
>      progs = ""
> 
>      for line in lines:
> -	if found_header:
> -	    progs = line.split(" ")
> -	    break
> +        if found_header:
> +            progs = line.split(" ")
> +            break
> 
> -	if "TESTLIST" in line:
> -	    found_header = True;
> +        if "TESTLIST" in line:
> +            found_header = True;
> 
>      return progs
> 
> @@ -101,21 +101,21 @@ for test in singleTests:
> 
>  def addSubTestCases(test):
>      proc = subprocess.Popen(
> -	    [path.join(igtTestRoot, test), '--list-subtests' ],
> -	    stdout=subprocess.PIPE,
> -	    stderr=subprocess.PIPE,
> -	    env=os.environ.copy(),
> -	    universal_newlines=True
> -	    )
> +            [path.join(igtTestRoot, test), '--list-subtests' ],
> +            stdout=subprocess.PIPE,
> +            stderr=subprocess.PIPE,
> +            env=os.environ.copy(),
> +            universal_newlines=True
> +            )
>      out, err = proc.communicate()
>      returncode = proc.returncode
> 
>      subtests = out.split("\n")
> 
>      for subtest in subtests:
> -	if subtest == "":
> -	    continue
> -	profile.test_list[path.join('igt', test, subtest)] = \
> +        if subtest == "":
> +            continue
> +        profile.test_list[path.join('igt', test, subtest)] = \
>              IGTTest(test, ['--run-subtest', subtest])
> 
>  multiTests = listTests("list-multi-tests")

I must have written this patch myself about a dozen times, no idea why I never 
sent it. Anyway this patch is:
reviewed-by: Dylan Baker <baker.dylan.c at gmail.com>
-------------- 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/20131112/18612826/attachment.pgp>


More information about the Piglit mailing list