Bug 1193224 - Remove vestigial --tests-root-dir option from xpcshell tests, r=ahal
authorJames Graham <james@hoppipolla.co.uk>
Tue, 18 Aug 2015 17:42:03 +0100
changeset 295628 46b3878338c22fa1ba8e662fa754adb272fec08e
parent 295627 70708e14dceb5f9a9b38cf51673218b8bd2e91a1
child 295629 9dfa459ee7e564b5f2bb79b03e9742a9394a24bc
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs1193224
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1193224 - Remove vestigial --tests-root-dir option from xpcshell tests, r=ahal
testing/xpcshell/mach_commands.py
testing/xpcshell/runxpcshelltests.py
testing/xpcshell/selftest.py
--- a/testing/xpcshell/mach_commands.py
+++ b/testing/xpcshell/mach_commands.py
@@ -157,17 +157,16 @@ class XPCShellRunner(MozbuildObject):
             'xpcshell': self.get_binary_path('xpcshell'),
             'mozInfo': os.path.join(self.topobjdir, 'mozinfo.json'),
             'symbolsPath': os.path.join(self.distdir, 'crashreporter-symbols'),
             'interactive': interactive,
             'keepGoing': keep_going,
             'logfiles': False,
             'sequential': sequential,
             'shuffle': shuffle,
-            'testsRootDir': tests_dir,
             'testingModulesDir': modules_dir,
             'profileName': 'firefox',
             'verbose': verbose or single_test,
             'xunitFilename': os.path.join(self.statedir, 'xpchsell.xunit.xml'),
             'xunitName': 'xpcshell',
             'pluginsPath': os.path.join(self.distdir, 'plugins'),
             'debugger': debugger,
             'debuggerArgs': debuggerArgs,
@@ -383,17 +382,16 @@ class B2GXPCShellRunner(MozbuildObject):
         options.localLib = self.bin_dir
         options.localBin = self.bin_dir
         options.logdir = self.xpcshell_dir
         options.manifest = os.path.join(self.xpcshell_dir, 'xpcshell.ini')
         options.mozInfo = os.path.join(self.topobjdir, 'mozinfo.json')
         options.objdir = self.topobjdir
         options.symbolsPath = os.path.join(self.distdir, 'crashreporter-symbols'),
         options.testingModulesDir = os.path.join(self.tests_dir, 'modules')
-        options.testsRootDir = self.xpcshell_dir
         options.testPath = test_path
         options.use_device_libs = True
 
         options.emulator = 'arm'
         if device_name.startswith('emulator'):
             if 'x86' in device_name:
                 options.emulator = 'x86'
 
--- a/testing/xpcshell/runxpcshelltests.py
+++ b/testing/xpcshell/runxpcshelltests.py
@@ -95,17 +95,17 @@ def cleanup_encoding(s):
 """ Control-C handling """
 gotSIGINT = False
 def markGotSIGINT(signum, stackFrame):
     global gotSIGINT
     gotSIGINT = True
 
 class XPCShellTestThread(Thread):
     def __init__(self, test_object, event, cleanup_dir_list, retry=True,
-            tests_root_dir=None, app_dir_key=None, interactive=False,
+            app_dir_key=None, interactive=False,
             verbose=False, pStdout=None, pStderr=None, keep_going=False,
             log=None, **kwargs):
         Thread.__init__(self)
         self.daemon = True
 
         self.test_object = test_object
         self.cleanup_dir_list = cleanup_dir_list
         self.retry = retry
@@ -125,17 +125,16 @@ class XPCShellTestThread(Thread):
         self.env = copy.deepcopy(kwargs.get('env'))
         self.symbolsPath = kwargs.get('symbolsPath')
         self.logfiles = kwargs.get('logfiles')
         self.xpcshell = kwargs.get('xpcshell')
         self.xpcsRunArgs = kwargs.get('xpcsRunArgs')
         self.failureManifest = kwargs.get('failureManifest')
         self.stack_fixer_function = kwargs.get('stack_fixer_function')
 
-        self.tests_root_dir = tests_root_dir
         self.app_dir_key = app_dir_key
         self.interactive = interactive
         self.verbose = verbose
         self.pStdout = pStdout
         self.pStderr = pStderr
         self.keep_going = keep_going
         self.log = log
 
@@ -1039,23 +1038,23 @@ class XPCShellTests(object):
         its path and the source manifest."""
 
         relpath_key = 'file_relpath' if 'file_relpath' in test_object else 'relpath'
         path = test_object[relpath_key].replace('\\', '/');
         if 'dupe-manifest' in test_object and 'ancestor-manifest' in test_object:
             return '%s:%s' % (os.path.basename(test_object['ancestor-manifest']), path)
         return path
 
-    def runTests(self, xpcshell, xrePath=None, appPath=None, symbolsPath=None,
+    def runTests(self, xpcshell=None, xrePath=None, appPath=None, symbolsPath=None,
                  manifest=None, testdirs=None, testPath=None, mobileArgs=None,
                  interactive=False, verbose=False, keepGoing=False, logfiles=True,
                  thisChunk=1, totalChunks=1, debugger=None,
                  debuggerArgs=None, debuggerInteractive=False,
                  profileName=None, mozInfo=None, sequential=False, shuffle=False,
-                 testsRootDir=None, testingModulesDir=None, pluginsPath=None,
+                 testingModulesDir=None, pluginsPath=None,
                  testClass=XPCShellTestThread, failureManifest=None,
                  log=None, stream=None, jsDebugger=False, jsDebuggerPort=0,
                  test_tags=None, dump_tests=None, utility_path=None, **otherOptions):
         """Run xpcshell tests.
 
         |xpcshell|, is the xpcshell executable to use to run the tests.
         |xrePath|, if provided, is the path to the XRE to use.
         |appPath|, if provided, is the path to an application directory.
@@ -1078,18 +1077,16 @@ class XPCShellTests(object):
           to launch xpcshell.
         |debuggerArgs|, if set, specifies arguments to use with the debugger.
         |debuggerInteractive|, if set, allows the debugger to be run in interactive
           mode.
         |profileName|, if set, specifies the name of the application for the profile
           directory if running only a subset of tests.
         |mozInfo|, if set, specifies specifies build configuration information, either as a filename containing JSON, or a dict.
         |shuffle|, if True, execute tests in random order.
-        |testsRootDir|, absolute path to root directory of all tests. This is used
-          by xUnit generation to determine the package name of the tests.
         |testingModulesDir|, if provided, specifies where JS modules reside.
           xpcshell will register a resource handler mapping this path.
         |otherOptions| may be present for the convenience of subclasses
         """
 
         global gotSIGINT
 
         if testdirs is None:
@@ -1274,23 +1271,20 @@ class XPCShellTests(object):
             # are re-run.
 
             path = test_object['path']
             test_object['id'] = self.makeTestId(test_object)
 
             if self.singleFile and not path.endswith(self.singleFile):
                 continue
 
-            if self.testPath and path.find(self.testPath) == -1:
-                continue
-
             self.testCount += 1
 
             test = testClass(test_object, self.event, self.cleanup_dir_list,
-                    tests_root_dir=testsRootDir, app_dir_key=appDirKey,
+                    app_dir_key=appDirKey,
                     interactive=interactive,
                     verbose=verbose or test_object.get("verbose") == "true",
                     pStdout=pStdout, pStderr=pStderr,
                     keep_going=keepGoing, log=self.log,
                     mobileArgs=mobileArgs, **kwargs)
             if 'run-sequentially' in test_object or self.sequential:
                 sequential_tests.append(test)
             else:
@@ -1372,17 +1366,17 @@ class XPCShellTests(object):
                     break
                 keep_going = test.keep_going
 
         # retry tests that failed when run in parallel
         if self.try_again_list:
             self.log.info("Retrying tests that failed when run in parallel.")
         for test_object in self.try_again_list:
             test = testClass(test_object, self.event, self.cleanup_dir_list,
-                    retry=False, tests_root_dir=testsRootDir,
+                    retry=False,
                     app_dir_key=appDirKey, interactive=interactive,
                     verbose=verbose, pStdout=pStdout, pStderr=pStderr,
                     keep_going=keepGoing, log=self.log, mobileArgs=mobileArgs,
                     **kwargs)
             test.start()
             test.join()
             self.addTestResults(test)
             # did the test encounter any exception?
@@ -1459,19 +1453,16 @@ class XPCShellOptions(OptionParser):
                         action="store_false", dest="logfiles",
                         help="don't create log files")
         self.add_option("--sequential",
                         action="store_true", dest="sequential", default=False,
                         help="Run all tests sequentially")
         self.add_option("--test-path",
                         type="string", dest="testPath", default=None,
                         help="single path and/or test filename to test")
-        self.add_option("--tests-root-dir",
-                        type="string", dest="testsRootDir", default=None,
-                        help="absolute path to directory where all tests are located. this is typically $(objdir)/_tests")
         self.add_option("--testing-modules-dir",
                         dest="testingModulesDir", default=None,
                         help="Directory where testing modules are located.")
         self.add_option("--test-plugin-path",
                         type="string", dest="pluginsPath", default=None,
                         help="Path to the location of a plugins directory containing the test plugin or plugins required for tests. "
                              "By default xpcshell's dir svc provider returns gre/plugins. Use test-plugin-path to add a directory "
                              "to return for NS_APP_PLUGINS_DIR_LIST when queried.")
--- a/testing/xpcshell/selftest.py
+++ b/testing/xpcshell/selftest.py
@@ -417,17 +417,16 @@ tail =
         Assert that self.x.runTests with manifest=self.manifest
         returns |expected|.
         """
         self.assertEquals(expected,
                           self.x.runTests(xpcshellBin,
                                           manifest=self.manifest,
                                           mozInfo=mozinfo.info,
                                           shuffle=shuffle,
-                                          testsRootDir=self.tempdir,
                                           verbose=verbose,
                                           sequential=True,
                                           utility_path=self.utility_path),
                           msg="""Tests should have %s, log:
 ========
 %s
 ========
 """ % ("passed" if expected else "failed", self.log.getvalue()))