Bug 914925 - Fix --debugger for reftest/mochitest on OS X. r=jmaher
☠☠ backed out by a23d608fb893 ☠ ☠
authorTed Mielczarek <ted.mielczarek@gmail.com>
Thu, 12 Sep 2013 09:05:19 -0400
changeset 146892 9157ea42ff41b276ffef8a896bd6cdf6fd314595
parent 146891 b6336472574b3656d8213a0200ecfe910cec7aa6
child 146893 735fa3a52510dbd8eed0c1ad74819c37327f5945
push id33738
push userryanvm@gmail.com
push dateFri, 13 Sep 2013 02:30:33 +0000
treeherdermozilla-inbound@23f0185620af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs914925
milestone26.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 914925 - Fix --debugger for reftest/mochitest on OS X. r=jmaher
build/automation.py.in
layout/tools/reftest/runreftest.py
testing/mochitest/runtests.py
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -466,17 +466,17 @@ class Automation(object):
       if ext == ".client":
         self.Process([pk12util, "-i", os.path.join(certPath, item), "-w",
                     pwfilePath, "-d", profileDir], 
                     env = env).wait()
 
     os.unlink(pwfilePath)
     return 0
 
-  def environment(self, env = None, xrePath = None, crashreporter = True):
+  def environment(self, env = None, xrePath = None, crashreporter = True, debugger = False):
     if xrePath == None:
       xrePath = self.DIST_BIN
     if env == None:
       env = dict(os.environ)
 
     ldLibraryPath = os.path.abspath(os.path.join(SCRIPT_DIR, xrePath))
     if self.UNIXISH or self.IS_MAC:
       envVar = "LD_LIBRARY_PATH"
@@ -485,17 +485,17 @@ class Automation(object):
       else: # unixish
         env['MOZILLA_FIVE_HOME'] = xrePath
       if envVar in env:
         ldLibraryPath = ldLibraryPath + ":" + env[envVar]
       env[envVar] = ldLibraryPath
     elif self.IS_WIN32:
       env["PATH"] = env["PATH"] + ";" + str(ldLibraryPath)
 
-    if crashreporter:
+    if crashreporter and not debugger:
       env['MOZ_CRASHREPORTER_NO_REPORT'] = '1'
       env['MOZ_CRASHREPORTER'] = '1'
     else:
       env['MOZ_CRASHREPORTER_DISABLE'] = '1'
 
     env['GNOME_DISABLE_CRASH_DIALOG'] = '1'
     env['XRE_NO_WINDOWS_CRASH_DIALOG'] = '1'
     env['NS_TRACE_MALLOC_DISABLE_STACKS'] = '1'
--- a/layout/tools/reftest/runreftest.py
+++ b/layout/tools/reftest/runreftest.py
@@ -103,18 +103,18 @@ class RefTest(object):
     profile = mozprofile.profile.Profile(
         addons=addons,
         preferences=prefs,
         locations=locations,
     )
     self.copyExtraFilesToProfile(options, profile)
     return profile
 
-  def buildBrowserEnv(self, options, profileDir):
-    browserEnv = self.automation.environment(xrePath = options.xrePath)
+  def buildBrowserEnv(self, options, profileDir, debugger = False):
+    browserEnv = self.automation.environment(xrePath = options.xrePath, debugger = debugger)
     browserEnv["XPCOM_DEBUG_BREAK"] = "stack"
 
     for v in options.environment:
       ix = v.find("=")
       if ix <= 0:
         print "Error: syntax error in --setenv=" + v
         return None
       browserEnv[v[:ix]] = v[ix + 1:]    
@@ -136,17 +136,17 @@ class RefTest(object):
     try:
       reftestlist = self.getManifestPath(testPath)
       if cmdlineArgs == None:
         cmdlineArgs = ['-reftest', reftestlist]
       profile = self.createReftestProfile(options, reftestlist)
       profileDir = profile.profile # name makes more sense
 
       # browser environment
-      browserEnv = self.buildBrowserEnv(options, profileDir)
+      browserEnv = self.buildBrowserEnv(options, profileDir, debuggerInfo is not None)
 
       self.automation.log.info("REFTEST INFO | runreftest.py | Running tests: start.\n")
       status = self.automation.runApp(None, browserEnv, options.app, profileDir,
                                  cmdlineArgs,
                                  utilityPath = options.utilityPath,
                                  xrePath=options.xrePath,
                                  debuggerInfo=debuggerInfo,
                                  symbolsPath=options.symbolsPath,
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -482,19 +482,19 @@ class Mochitest(MochitestUtilsMixin):
     #if we don't do this, the profile object is destroyed when we exit this method
     self.profile = profile
     options.profilePath = profile.profile
 
     manifest = self.addChromeToProfile(options)
     self.copyExtraFilesToProfile(options)
     return manifest
 
-  def buildBrowserEnv(self, options):
+  def buildBrowserEnv(self, options, debugger = False):
     """ build the environment variables for the specific test and operating system """
-    browserEnv = self.automation.environment(xrePath = options.xrePath)
+    browserEnv = self.automation.environment(xrePath = options.xrePath, debugger = debugger)
 
     # These variables are necessary for correct application startup; change
     # via the commandline at your own risk.
     browserEnv["XPCOM_DEBUG_BREAK"] = "stack"
 
     for v in options.environment:
       ix = v.find("=")
       if ix <= 0:
@@ -546,17 +546,17 @@ class Mochitest(MochitestUtilsMixin):
 
   def runTests(self, options, onLaunch=None):
     """ Prepare, configure, run tests and cleanup """
     debuggerInfo = getDebuggerInfo(self.oldcwd, options.debugger, options.debuggerArgs,
                       options.debuggerInteractive);
 
     self.leak_report_file = os.path.join(options.profilePath, "runtests_leaks.log")
 
-    browserEnv = self.buildBrowserEnv(options)
+    browserEnv = self.buildBrowserEnv(options, debuggerInfo is not None)
     if browserEnv is None:
       return 1
 
     manifest = self.buildProfile(options)
     if manifest is None:
       return 1
 
     self.startWebServer(options)