[Piglit] [PATCH] framework/test/{opencv, oclconform}: fix subprocess returning bytes

Dylan Baker baker.dylan.c at gmail.com
Wed Feb 10 21:42:12 UTC 2016


During the hybridization this little bit was missed, causing the to
subprocess to return bytes, while the rest of the code expected unicode.

cc: Tom Stellard <tom at stellard.net>
Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---

I think this hsould fix your issue Tom, but I'm not exactly sure how to
set up opencv tests and oclconform to check.

 framework/test/oclconform.py | 4 ++--
 framework/test/opencv.py     | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/framework/test/oclconform.py b/framework/test/oclconform.py
index 48e4b72..cad00dd 100644
--- a/framework/test/oclconform.py
+++ b/framework/test/oclconform.py
@@ -91,8 +91,8 @@ def add_oclconform_tests(profile):
             run_subtests = PIGLIT_CONFIG.get(test_section_name, 'run_subtest')
             list_tests = list_tests.split()
 
-            subtests = subprocess.check_output(args=list_tests,
-                                               cwd=bindir).split('\n')
+            subtests = subprocess.check_output(
+                args=list_tests, cwd=bindir).decode('utf-8').split('\n')
             for subtest in subtests:
                 m = re.match(subtest_regex, subtest)
                 if not m:
diff --git a/framework/test/opencv.py b/framework/test/opencv.py
index 3b9a12e..a31d562 100644
--- a/framework/test/opencv.py
+++ b/framework/test/opencv.py
@@ -60,7 +60,8 @@ def add_opencv_tests(profile):
         print('Warning: {} does not exist.\nSkipping OpenCV '
               'tests...'.format(opencv_test_ocl))
         return
-    tests = subprocess.check_output([opencv_test_ocl, '--gtest_list_tests'])
+    tests = subprocess.check_output(
+        [opencv_test_ocl, '--gtest_list_tests']).decode('utf-8')
     test_list = tests.splitlines()
     group_name = ''
     full_test_name = ''
-- 
2.7.1



More information about the Piglit mailing list