Bug 1386826 - Whitelist the objdir, so _tests gets covered. r?jmaher draft
authorGian-Carlo Pascutto <gcp@mozilla.com>
Wed, 16 Aug 2017 19:03:09 +0200
changeset 648283 1e86e6d0638cec7c7374e0fe225c2908ddc147ec
parent 647668 6240e75545e67d545e583055e95557610a5fadde
child 726765 9f5f92e2b106a0c114545a74706b5c9252da620d
push id74689
push usergpascutto@mozilla.com
push dateThu, 17 Aug 2017 14:03:25 +0000
reviewersjmaher
bugs1386826
milestone57.0a1
Bug 1386826 - Whitelist the objdir, so _tests gets covered. r?jmaher MozReview-Commit-ID: 8SHk1Pfy37I
layout/tools/reftest/mach_commands.py
layout/tools/reftest/reftestcommandline.py
layout/tools/reftest/runreftest.py
testing/mochitest/mochitest_options.py
testing/mochitest/runtests.py
--- a/layout/tools/reftest/mach_commands.py
+++ b/layout/tools/reftest/mach_commands.py
@@ -74,16 +74,17 @@ class ReftestRunner(MozbuildObject):
             "crashtest": (self.topsrcdir, "testing", "crashtest", "crashtests.list"),
             "jstestbrowser": (self.topobjdir, "dist", "test-stage", "jsreftest", "tests",
                               "jstests.list")
         }
 
         args.extraProfileFiles.append(os.path.join(self.topobjdir, "dist", "plugins"))
         args.symbolsPath = os.path.join(self.topobjdir, "crashreporter-symbols")
         args.workPath = self.topsrcdir
+        args.objPath = self.topobjdir
 
         if not args.tests:
             args.tests = [os.path.join(*default_manifest[args.suite])]
 
         if args.suite == "jstestbrowser":
             args.extraProfileFiles.append(os.path.join(self.topobjdir, "dist",
                                                        "test-stage", "jsreftest",
                                                        "tests", "user.js"))
--- a/layout/tools/reftest/reftestcommandline.py
+++ b/layout/tools/reftest/reftestcommandline.py
@@ -239,17 +239,22 @@ class ReftestArgumentsParser(argparse.Ar
         self.add_argument("tests",
                           metavar="TEST_PATH",
                           nargs="*",
                           help="Path to test file, manifest file, or directory containing tests")
 
         self.add_argument("--work-path",
                           action="store",
                           dest="workPath",
-                          help="Path to the base dir of all test files.")
+                          help="Path to the base dir of all source files.")
+
+        self.add_argument("--obj-path",
+                          action="store",
+                          dest="objPath",
+                          help="Path to the base dir of all object files.")
 
         mozlog.commandline.add_logging_group(self)
 
     def get_ip(self):
         import moznetwork
         if os.name != "nt":
             return moznetwork.get_ip()
         else:
--- a/layout/tools/reftest/runreftest.py
+++ b/layout/tools/reftest/runreftest.py
@@ -305,16 +305,21 @@ class RefTest(object):
             prefs['layers.acceleration.disabled'] = True
 
         sandbox_whitelist_paths = [SCRIPT_DIRECTORY]
         try:
             if options.workPath:
                 sandbox_whitelist_paths.append(options.workPath)
         except AttributeError:
             pass
+        try:
+            if options.objPath:
+                sandbox_whitelist_paths.append(options.objPath)
+        except AttributeError:
+            pass
         if (platform.system() == "Linux" or
             platform.system() in ("Windows", "Microsoft")):
             # Trailing slashes are needed to indicate directories on Linux and Windows
             sandbox_whitelist_paths = map(lambda p: os.path.join(p, ""),
                                           sandbox_whitelist_paths)
 
         # Bug 1300355: Disable canvas cache for win7 as it uses
         # too much memory and causes OOMs.
--- a/testing/mochitest/mochitest_options.py
+++ b/testing/mochitest/mochitest_options.py
@@ -599,17 +599,23 @@ class MochitestArguments(ArgumentContain
          {"default": None,
           "dest": "failure_pattern_file",
           "help": "File describes all failure patterns of the tests.",
           "suppress": True,
           }],
         [["--work-path"],
          {"default": None,
           "dest": "workPath",
-          "help": "Path to the base dir of all test files.",
+          "help": "Path to the base dir of all source files.",
+          "suppress": True,
+          }],
+        [["--obj-path"],
+         {"default": None,
+          "dest": "objPath",
+          "help": "Path to the base dir of all object files.",
           "suppress": True,
           }],
         [["--verify"],
          {"action": "store_true",
           "default": False,
           "help": "Test verification mode.",
           "suppress": True,
           }],
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -1804,18 +1804,18 @@ toolbar#nav-bar {
 
         sandbox_whitelist_paths = [SCRIPT_DIR]
         try:
             if options.workPath:
                 sandbox_whitelist_paths.append(options.workPath)
         except AttributeError:
             pass
         try:
-            if options.topsrcdir:
-                sandbox_whitelist_paths.append(options.topsrcdir)
+            if options.objPath:
+                sandbox_whitelist_paths.append(options.objPath)
         except AttributeError:
             pass
         if (platform.system() == "Linux" or
             platform.system() in ("Windows", "Microsoft")):
             # Trailing slashes are needed to indicate directories on Linux and Windows
             sandbox_whitelist_paths = map(lambda p: os.path.join(p, ""),
                                           sandbox_whitelist_paths)