[WPE] API tests can't run in flatpak environment
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Jan 2019 10:59:45 +0000 (10:59 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Jan 2019 10:59:45 +0000 (10:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193242

Reviewed by Michael Catanzaro.

* Scripts/run-wpe-tests: Add --wpe to arguments passed to
flatpakutils so that it knows which port it's dealing with.
* glib/common.py: Remove build_dir globals so that subsequent
calls actually take args into account.
(library_build_path):
(binary_build_path):

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

Tools/ChangeLog
Tools/Scripts/run-wpe-tests
Tools/glib/common.py

index f21329f..066feaa 100644 (file)
@@ -1,3 +1,17 @@
+2019-01-09  Philippe Normand  <pnormand@igalia.com>
+
+        [WPE] API tests can't run in flatpak environment
+        https://bugs.webkit.org/show_bug.cgi?id=193242
+
+        Reviewed by Michael Catanzaro.
+
+        * Scripts/run-wpe-tests: Add --wpe to arguments passed to
+        flatpakutils so that it knows which port it's dealing with.
+        * glib/common.py: Remove build_dir globals so that subsequent
+        calls actually take args into account.
+        (library_build_path):
+        (binary_build_path):
+
 2019-01-08  Dean Jackson  <dino@apple.com>
 
         Blob references for System Previews don't get a correct file extension
index 5c682f8..e77ebe9 100755 (executable)
@@ -44,7 +44,7 @@ class WPETestRunner(TestRunner):
 
 
 if __name__ == "__main__":
-    flatpakutils.run_in_sandbox_if_available(sys.argv)
+    flatpakutils.run_in_sandbox_if_available([sys.argv[0], "--wpe"] + sys.argv[1:])
     if not flatpakutils.is_sandboxed() and not jhbuildutils.enter_jhbuild_environment_if_available("wpe"):
         print '***'
         print '*** Warning: jhbuild environment not present and not running in flatpak.'
@@ -55,7 +55,11 @@ if __name__ == "__main__":
     add_options(option_parser);
     option_parser.add_option('--display-server', choices=['headless', 'wayland'], default='headless',
                              help='"headless": Use headless view backend. "wayland": Use the current wayland session.'),
-    options, args = option_parser.parse_args()
+
+    args = sys.argv[1:]
+    if flatpakutils.is_sandboxed():
+        args = [ arg for arg in args if arg != "--wpe" ]
+    options, args = option_parser.parse_args(args)
 
     logging.basicConfig(level=logging.INFO, format="%(message)s")
 
index 8a7b2fb..9dc6561 100644 (file)
@@ -23,8 +23,6 @@ import sys
 
 top_level_dir = None
 build_dir = None
-library_build_dir = None
-binary_build_dir = None
 build_types = ('Release', 'Debug')
 
 
@@ -41,17 +39,11 @@ def set_build_types(new_build_types):
 
 
 def library_build_path(*args):
-    global library_build_dir
-    if not library_build_dir:
-        library_build_dir = build_path('lib', *args)
-    return library_build_dir
+    return build_path('lib', *args)
 
 
 def binary_build_path(*args):
-    global binary_build_dir
-    if not binary_build_dir:
-        binary_build_dir = build_path('bin', *args)
-    return binary_build_dir
+    return build_path('bin', *args)
 
 
 def get_build_path(fatal=True):