Title: [154600] trunk/Tools
Revision
154600
Author
[email protected]
Date
2013-08-26 06:10:00 -0700 (Mon, 26 Aug 2013)

Log Message

[GTK] Allow to run tests without Xvfb in run-gtk-tests
https://bugs.webkit.org/show_bug.cgi?id=120298

Reviewed by Philippe Normand.

Add --no-xvfb command line option to run tests in the current
display.

* Scripts/run-gtk-tests:
(TestRunner._run_xvfb): Return early if option --no-xvfb has been
passed.
(TestRunner._setup_testing_environment): Use helper function
_run_xvfb to start Xvfb if needed.
(TestRunner._tear_down_testing_environment): Check Xvfb is
actually running before trying to terminate it.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (154599 => 154600)


--- trunk/Tools/ChangeLog	2013-08-26 12:45:18 UTC (rev 154599)
+++ trunk/Tools/ChangeLog	2013-08-26 13:10:00 UTC (rev 154600)
@@ -1,3 +1,21 @@
+2013-08-26  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] Allow to run tests without Xvfb in run-gtk-tests
+        https://bugs.webkit.org/show_bug.cgi?id=120298
+
+        Reviewed by Philippe Normand.
+
+        Add --no-xvfb command line option to run tests in the current
+        display.
+
+        * Scripts/run-gtk-tests:
+        (TestRunner._run_xvfb): Return early if option --no-xvfb has been
+        passed.
+        (TestRunner._setup_testing_environment): Use helper function
+        _run_xvfb to start Xvfb if needed.
+        (TestRunner._tear_down_testing_environment): Check Xvfb is
+        actually running before trying to terminate it.
+
 2013-08-26  Zoltan Arvai  <[email protected]>
 
         Adding Gabor Abraham to contributors.json.

Modified: trunk/Tools/Scripts/run-gtk-tests (154599 => 154600)


--- trunk/Tools/Scripts/run-gtk-tests	2013-08-26 12:45:18 UTC (rev 154599)
+++ trunk/Tools/Scripts/run-gtk-tests	2013-08-26 13:10:00 UTC (rev 154600)
@@ -166,14 +166,12 @@
 
         return True
 
-    def _setup_testing_environment(self):
-        self._test_env = os.environ
+    def _run_xvfb(self):
+        self._xvfb = None
+        if not self._options.use_xvfb:
+            return True
+
         self._test_env["DISPLAY"] = self._options.display
-        self._test_env["WEBKIT_INSPECTOR_PATH"] = os.path.abspath(os.path.join(self._programs_path, 'resources', 'inspector'))
-        self._test_env['GSETTINGS_BACKEND'] = 'memory'
-        self._test_env["TEST_WEBKIT_API_WEBKIT2_RESOURCES_PATH"] = common.top_level_path("Tools", "TestWebKitAPI", "Tests", "WebKit2")
-        self._test_env["TEST_WEBKIT_API_WEBKIT2_INJECTED_BUNDLE_PATH"] = common.build_path_for_build_types((self._build_type,), "Libraries")
-        self._test_env["WEBKIT_EXEC_PATH"] = self._programs_path
 
         try:
             self._xvfb = subprocess.Popen(["Xvfb", self._options.display, "-screen", "0", "800x600x24", "-nolisten", "tcp"],
@@ -183,6 +181,19 @@
             sys.stderr.flush()
             return False
 
+        return True
+
+    def _setup_testing_environment(self):
+        self._test_env = os.environ
+        self._test_env["WEBKIT_INSPECTOR_PATH"] = os.path.abspath(os.path.join(self._programs_path, 'resources', 'inspector'))
+        self._test_env['GSETTINGS_BACKEND'] = 'memory'
+        self._test_env["TEST_WEBKIT_API_WEBKIT2_RESOURCES_PATH"] = common.top_level_path("Tools", "TestWebKitAPI", "Tests", "WebKit2")
+        self._test_env["TEST_WEBKIT_API_WEBKIT2_INJECTED_BUNDLE_PATH"] = common.build_path_for_build_types((self._build_type,), "Libraries")
+        self._test_env["WEBKIT_EXEC_PATH"] = self._programs_path
+
+        if not self._run_xvfb():
+            return False
+
         # If we cannot start the accessibility daemons, we can just skip the accessibility tests.
         if not self._start_accessibility_daemons():
             print "Could not start accessibility bus, so skipping TestWebKitAccessibility"
@@ -194,7 +205,8 @@
             self._spi_registryd.terminate()
         if self._spi_bus_launcher:
             self._spi_bus_launcher.terminate()
-        self._xvfb.terminate()
+        if self._xvfb:
+            self._xvfb.terminate()
 
     def _test_cases_to_skip(self, test_program):
         if self._options.skipped_action != 'skip':
@@ -392,6 +404,8 @@
     option_parser.add_option('-t', '--timeout',
                              action='', type='int', dest='timeout', default=10,
                              help='Time in seconds until a test times out')
+    option_parser.add_option('--no-xvfb', action='', dest='use_xvfb', default=True,
+                             help='Do not run tests under Xvfb')
     options, args = option_parser.parse_args()
 
     sys.exit(TestRunner(options, args).run_tests())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to