[Piglit] [PATCH 1/2] opencv: Automatically run tests concurrently when render-nodes are present

Dylan Baker baker.dylan.c at gmail.com
Fri Jan 23 11:38:05 PST 2015


Oddly patch 2 showed up well before patch 1 did, I have a few comments,
but generally this patch seems fine.

On Friday, January 23, 2015 12:54:58 Tom Stellard wrote:
> ---
>  framework/test/opencv.py | 11 ++++++-----
>  tests/cl.py              |  9 ++++-----
>  tests/quick_cl.py        |  4 ++--
>  3 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/framework/test/opencv.py b/framework/test/opencv.py
> index 2c3d627..2eca948 100644
> --- a/framework/test/opencv.py
> +++ b/framework/test/opencv.py
> @@ -38,14 +38,14 @@ __all__ = [
>  
>  
>  class OpenCVTest(GTest):
> -    def __init__(self, test_prog, testname):
> +    def __init__(self, test_prog, testname, should_run_concurrent):
>          options = [test_prog, '--gtest_filter=' + testname, '--gtest_color=no']
>          if PIGLIT_CONFIG.has_option('opencv', 'workdir'):
>              options.append('-w {}'.format(PIGLIT_CONFIG.get('opencv', 'workdir')))
> -        GTest.__init__(self, options)
> +        GTest.__init__(self, options, run_concurrent = should_run_concurrent)

No spaces around = in function signatures please.

>  
>  
> -def add_opencv_tests(profile):
> +def add_opencv_tests(profile, should_run_concurrent = False):

and here

>      if not PIGLIT_CONFIG.has_option('opencv', 'opencv_test_ocl_bindir'):
>          return
>  
> @@ -69,7 +69,7 @@ def add_opencv_tests(profile):
>              full_test_name = 'opencv/{}'.format(group_desc)
>              if not individual:
>                  profile.tests[full_test_name] = OpenCVTest(opencv_test_ocl,
> -                    '{}*'.format(group_name))
> +                    '{}*'.format(group_name), should_run_concurrent)
>              continue
>  
>          if not individual:
> @@ -80,4 +80,5 @@ def add_opencv_tests(profile):
>          if m:
>              test_name = m.group(1)
>              profile.tests[grouptools.join(full_test_name, test_name)] = \
> -                OpenCVTest(opencv_test_ocl, '{}{}'.format(group_name ,test_name))
> +                OpenCVTest(opencv_test_ocl, '{}{}'.format(group_name ,test_name),
> +                           should_run_concurrent)
> diff --git a/tests/cl.py b/tests/cl.py
> index 06301af..0915279 100644
> --- a/tests/cl.py
> +++ b/tests/cl.py
> @@ -22,13 +22,12 @@ __all__ = ['profile']
>  ######
>  # Helper functions
>  
> -can_do_concurrent = (not sys.platform.startswith('linux') or
> -                     glob.glob('/dev/dri/render*'))
> -
> +def cl_can_do_concurrent():
> +        return (not sys.platform.startswith('linux') or
> +                glob.glob('/dev/dri/render*'))

4 space indent with no tabs.

Is there a reason this needs to be a function, it's perfectly reasonable
to export a constant from a module.

>  
>  def add_plain_test(group, name, args):
> -    group[name] = PiglitCLTest(args, run_concurrent=can_do_concurrent)
> -
> +        group[name] = PiglitCLTest(args, run_concurrent=cl_can_do_concurrent())

4 space indent, no tabs

>  
>  def add_plain_program_tester_test(group, name, path):
>      add_plain_test(group, name, ['cl-program-tester', path])
> diff --git a/tests/quick_cl.py b/tests/quick_cl.py
> index 7f82a86..5d46d45 100644
> --- a/tests/quick_cl.py
> +++ b/tests/quick_cl.py
> @@ -24,8 +24,8 @@
>  # Authors: Tom Stellard <thomas.stellard at amd.com>
>  #
>  
> -from tests.cl import profile
> +from tests.cl import profile, cl_can_do_concurrent
>  from framework.test import add_opencv_tests, add_oclconform_tests
>  
> -add_opencv_tests(profile)
> +add_opencv_tests(profile, cl_can_do_concurrent())
>  add_oclconform_tests(profile)
> -- 
> 1.8.5.5
> 
> _______________________________________________
> 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/20150123/a9300920/attachment.sig>


More information about the Piglit mailing list