bug 485436 - work around OS X 10.4 xpcshell bustage with smarter default setting in runtests.py. r=waldo
authorTed Mielczarek <ted.mielczarek@gmail.com>
Mon, 06 Apr 2009 07:33:27 -0400
changeset 24237 7878db4aa2639953cfc90f6870e4ce3f1b2ac83b
parent 24236 2fc99e5864601de17d99b2cca45fee372dceaafd
child 24238 290370c26b83f82ad0d0b3dd960450919d2db96a
push id1095
push usertmielczarek@mozilla.com
push dateMon, 06 Apr 2009 14:54:54 +0000
reviewerswaldo
bugs485436
milestone1.9.1b4pre
bug 485436 - work around OS X 10.4 xpcshell bustage with smarter default setting in runtests.py. r=waldo
testing/mochitest/runtests.py.in
--- a/testing/mochitest/runtests.py.in
+++ b/testing/mochitest/runtests.py.in
@@ -342,31 +342,36 @@ def searchPath(path):
 #################
 # MAIN FUNCTION #
 #################
 
 def main():
   parser = MochitestOptions()
   options, args = parser.parse_args()
 
+  if options.xrePath is None:
+    # default xrePath to the app path if not provided
+    # but only if an app path was explicitly provided
+    if options.app != parser.defaults['app']:
+      options.xrePath = os.path.dirname(options.app)
+    else:
+      # otherwise default to dist/bin
+      options.xrePath = automation.DIST_BIN
+
+  # allow relative paths
+  options.xrePath = getFullPath(options.xrePath)
+
   options.app = getFullPath(options.app)
   if not os.path.exists(options.app):
     msg = """\
 Error: Path %(app)s doesn't exist.
 Are you executing $objdir/_tests/testing/mochitest/runtests.py?"""
     print msg % {"app": options.app}
     sys.exit(1)
 
-  # default xrePath to the app path if not provided
-  if options.xrePath is None:
-    options.xrePath = os.path.dirname(options.app)
-  else:
-    # allow relative paths
-    options.xrePath = getFullPath(options.xrePath)
-
   options.utilityPath = getFullPath(options.utilityPath)
   options.certPath = getFullPath(options.certPath)
 
   debuggerInfo = None
 
   if options.debugger:
     debuggerPath = searchPath(options.debugger)
     if not debuggerPath: