[WPE] Remove hard dependency on subprocess32 for the API tests
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jan 2019 14:34:50 +0000 (14:34 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jan 2019 14:34:50 +0000 (14:34 +0000)
Rubber-stamped by Carlos Garcia Campos.

* glib/api_test_runner.py:
(TestRunner._run_test_qt): Lazily import subprocess32 and check
its presence only when running WPEQt tests.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240433 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/glib/api_test_runner.py

index 4c27d0d..7c7a865 100644 (file)
@@ -1,3 +1,13 @@
+2019-01-24  Philippe Normand  <pnormand@igalia.com>
+
+        [WPE] Remove hard dependency on subprocess32 for the API tests
+
+        Rubber-stamped by Carlos Garcia Campos.
+
+        * glib/api_test_runner.py:
+        (TestRunner._run_test_qt): Lazily import subprocess32 and check
+        its presence only when running WPEQt tests.
+
 2019-01-24  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GLIB] Expose JavaScriptCore options in GLib public API
index 7afe544..08887bc 100755 (executable)
@@ -32,7 +32,10 @@ from webkitpy.common.test_expectations import TestExpectations
 from webkitpy.common.timeout_context import Timeout
 
 if os.name == 'posix' and sys.version_info[0] < 3:
-    import subprocess32 as subprocess
+    try:
+        import subprocess32 as subprocess
+    except ImportError:
+        import subprocess
 else:
     import subprocess
 
@@ -166,6 +169,10 @@ class TestRunner(object):
         env['QML2_IMPORT_PATH'] = common.library_build_path('qml')
 
         name = os.path.basename(test_program)
+        if not hasattr(subprocess, 'TimeoutExpired'):
+            print("Can't run WPEQt test in Python2 without subprocess32")
+            return {name: "FAIL"}
+
         try:
             output = subprocess.check_output([test_program, ], stderr=subprocess.STDOUT,
                                              env=env, timeout=self._options.timeout)