2012-04-27 18:44:59 +00:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2013-10-01 14:32:58 +00:00
|
|
|
import json
|
2012-04-27 18:44:59 +00:00
|
|
|
import os
|
2013-07-26 18:40:04 +00:00
|
|
|
import posixpath
|
2013-01-04 18:41:34 +00:00
|
|
|
import shutil
|
2012-04-27 18:44:59 +00:00
|
|
|
import sys
|
|
|
|
import tempfile
|
2013-01-04 18:41:34 +00:00
|
|
|
import threading
|
2012-06-15 21:13:04 +00:00
|
|
|
import traceback
|
2012-04-27 18:44:59 +00:00
|
|
|
|
2013-08-26 21:17:51 +00:00
|
|
|
here = os.path.abspath(os.path.dirname(__file__))
|
2013-03-28 20:42:49 +00:00
|
|
|
sys.path.insert(0, here)
|
2012-04-27 18:44:59 +00:00
|
|
|
|
2013-08-14 17:57:43 +00:00
|
|
|
from runtests import Mochitest
|
2013-07-26 18:40:04 +00:00
|
|
|
from runtests import MochitestUtilsMixin
|
2012-04-27 18:44:59 +00:00
|
|
|
from runtests import MochitestServer
|
2013-07-26 18:40:04 +00:00
|
|
|
from mochitest_options import B2GOptions, MochitestOptions
|
2012-04-27 18:44:59 +00:00
|
|
|
|
|
|
|
from marionette import Marionette
|
|
|
|
|
2013-07-26 18:40:04 +00:00
|
|
|
from mozdevice import DeviceManagerADB
|
2013-08-14 17:57:43 +00:00
|
|
|
from mozprofile import Profile, Preferences
|
2013-07-26 18:40:04 +00:00
|
|
|
import mozlog
|
|
|
|
import mozinfo
|
|
|
|
|
|
|
|
log = mozlog.getLogger('Mochitest')
|
|
|
|
|
|
|
|
class B2GMochitest(MochitestUtilsMixin):
|
2014-06-19 18:17:26 +00:00
|
|
|
marionette = None
|
|
|
|
|
|
|
|
def __init__(self, marionette_args,
|
2013-07-26 18:40:04 +00:00
|
|
|
out_of_process=True,
|
|
|
|
profile_data_dir=None,
|
|
|
|
locations=os.path.join(here, 'server-locations.txt')):
|
|
|
|
super(B2GMochitest, self).__init__()
|
2014-06-19 18:17:26 +00:00
|
|
|
self.marionette_args = marionette_args
|
2013-07-26 18:40:04 +00:00
|
|
|
self.out_of_process = out_of_process
|
2014-03-14 18:25:41 +00:00
|
|
|
self.locations_file = locations
|
2013-03-28 20:42:49 +00:00
|
|
|
self.preferences = []
|
|
|
|
self.webapps = None
|
2013-07-26 18:40:04 +00:00
|
|
|
self.test_script = os.path.join(here, 'b2g_start_script.js')
|
|
|
|
self.test_script_args = [self.out_of_process]
|
|
|
|
self.product = 'b2g'
|
2013-03-28 20:42:49 +00:00
|
|
|
|
|
|
|
if profile_data_dir:
|
|
|
|
self.preferences = [os.path.join(profile_data_dir, f)
|
|
|
|
for f in os.listdir(profile_data_dir) if f.startswith('pref')]
|
|
|
|
self.webapps = [os.path.join(profile_data_dir, f)
|
|
|
|
for f in os.listdir(profile_data_dir) if f.startswith('webapp')]
|
|
|
|
|
2013-07-26 18:40:04 +00:00
|
|
|
# mozinfo is populated by the parent class
|
|
|
|
if mozinfo.info['debug']:
|
|
|
|
self.SERVER_STARTUP_TIMEOUT = 180
|
2013-01-04 18:41:34 +00:00
|
|
|
else:
|
2013-07-26 18:40:04 +00:00
|
|
|
self.SERVER_STARTUP_TIMEOUT = 90
|
2013-03-22 15:41:07 +00:00
|
|
|
|
2013-07-26 18:40:04 +00:00
|
|
|
def setup_common_options(self, options):
|
|
|
|
test_url = self.buildTestPath(options)
|
2014-06-16 18:51:22 +00:00
|
|
|
# For B2G emulators buildURLOptions has been called
|
|
|
|
# without calling buildTestPath first and that
|
|
|
|
# causes manifestFile not to be set
|
|
|
|
if not "manifestFile=tests.json" in self.urlOpts:
|
|
|
|
self.urlOpts.append("manifestFile=%s" % options.manifestFile)
|
|
|
|
|
2013-07-26 18:40:04 +00:00
|
|
|
if len(self.urlOpts) > 0:
|
|
|
|
test_url += "?" + "&".join(self.urlOpts)
|
|
|
|
self.test_script_args.append(test_url)
|
2013-01-04 18:41:34 +00:00
|
|
|
|
2014-03-18 15:03:51 +00:00
|
|
|
def buildTestPath(self, options):
|
2014-06-16 18:51:22 +00:00
|
|
|
if options.manifestFile != 'tests.json':
|
|
|
|
super(B2GMochitest, self).buildTestPath(options, disabled=False)
|
2014-03-18 15:03:51 +00:00
|
|
|
return self.buildTestURL(options)
|
|
|
|
|
2013-07-26 18:40:04 +00:00
|
|
|
def build_profile(self, options):
|
2013-03-28 20:42:49 +00:00
|
|
|
# preferences
|
|
|
|
prefs = {}
|
|
|
|
for path in self.preferences:
|
|
|
|
prefs.update(Preferences.read_prefs(path))
|
|
|
|
|
|
|
|
for v in options.extraPrefs:
|
|
|
|
thispref = v.split("=", 1)
|
|
|
|
if len(thispref) < 2:
|
|
|
|
print "Error: syntax error in --setpref=" + v
|
|
|
|
sys.exit(1)
|
|
|
|
prefs[thispref[0]] = thispref[1]
|
|
|
|
|
|
|
|
# interpolate the preferences
|
|
|
|
interpolation = { "server": "%s:%s" % (options.webServer, options.httpPort),
|
2013-07-26 18:40:04 +00:00
|
|
|
"OOP": "true" if self.out_of_process else "false" }
|
2013-03-28 20:42:49 +00:00
|
|
|
prefs = json.loads(json.dumps(prefs) % interpolation)
|
2013-04-10 00:31:42 +00:00
|
|
|
for pref in prefs:
|
|
|
|
prefs[pref] = Preferences.cast(prefs[pref])
|
2013-03-28 20:42:49 +00:00
|
|
|
|
2013-04-10 00:13:32 +00:00
|
|
|
kwargs = {
|
|
|
|
'addons': self.getExtensionsToInstall(options),
|
|
|
|
'apps': self.webapps,
|
2014-03-14 18:25:41 +00:00
|
|
|
'locations': self.locations_file,
|
2013-04-10 00:13:32 +00:00
|
|
|
'preferences': prefs,
|
|
|
|
'proxy': {"remote": options.webServer}
|
|
|
|
}
|
|
|
|
|
|
|
|
if options.profile:
|
|
|
|
self.profile = Profile.clone(options.profile, **kwargs)
|
|
|
|
else:
|
|
|
|
self.profile = Profile(**kwargs)
|
2013-03-28 20:42:49 +00:00
|
|
|
|
|
|
|
options.profilePath = self.profile.profile
|
|
|
|
# TODO bug 839108 - mozprofile should probably handle this
|
|
|
|
manifest = self.addChromeToProfile(options)
|
|
|
|
self.copyExtraFilesToProfile(options)
|
|
|
|
return manifest
|
2013-01-04 18:41:34 +00:00
|
|
|
|
2013-07-26 18:40:04 +00:00
|
|
|
def run_tests(self, options):
|
|
|
|
""" Prepare, configure, run tests and cleanup """
|
2013-01-04 18:41:34 +00:00
|
|
|
|
2013-07-26 18:40:04 +00:00
|
|
|
manifest = self.build_profile(options)
|
2014-06-23 09:24:00 +00:00
|
|
|
self.leak_report_file = os.path.join(options.profilePath, "runtests_leaks.log")
|
2013-01-04 01:37:26 +00:00
|
|
|
|
2013-10-18 19:47:35 +00:00
|
|
|
if options.debugger or not options.autorun:
|
2013-07-26 18:40:04 +00:00
|
|
|
timeout = None
|
|
|
|
else:
|
2013-10-18 19:47:35 +00:00
|
|
|
if not options.timeout:
|
|
|
|
if mozinfo.info['debug']:
|
|
|
|
options.timeout = 420
|
|
|
|
else:
|
|
|
|
options.timeout = 300
|
|
|
|
timeout = options.timeout + 30.0
|
2012-04-27 18:44:59 +00:00
|
|
|
|
2013-07-26 18:40:04 +00:00
|
|
|
log.info("runtestsb2g.py | Running tests: start.")
|
|
|
|
status = 0
|
|
|
|
try:
|
2014-06-19 18:17:26 +00:00
|
|
|
self.marionette_args['profile'] = self.profile
|
|
|
|
self.marionette = Marionette(**self.marionette_args)
|
|
|
|
self.runner = self.marionette.runner
|
|
|
|
self.app_ctx = self.runner.app_ctx
|
|
|
|
|
|
|
|
self.remote_log = posixpath.join(self.app_ctx.remote_test_root,
|
|
|
|
'log', 'mochitest.log')
|
|
|
|
if not self.app_ctx.dm.dirExists(posixpath.dirname(self.remote_log)):
|
|
|
|
self.app_ctx.dm.mkDirs(self.remote_log)
|
|
|
|
|
|
|
|
self.startServers(options, None)
|
|
|
|
self.buildURLOptions(options, {'MOZ_HIDE_RESULTS_TABLE': '1'})
|
|
|
|
self.test_script_args.append(not options.emulator)
|
|
|
|
self.test_script_args.append(options.wifi)
|
|
|
|
|
|
|
|
|
2013-07-26 18:40:04 +00:00
|
|
|
self.runner.start(outputTimeout=timeout)
|
2014-06-19 18:17:26 +00:00
|
|
|
|
|
|
|
self.marionette.wait_for_port()
|
|
|
|
self.marionette.start_session()
|
|
|
|
self.marionette.set_context(self.marionette.CONTEXT_CHROME)
|
|
|
|
|
|
|
|
# Disable offline status management (bug 777145), otherwise the network
|
|
|
|
# will be 'offline' when the mochitests start. Presumably, the network
|
|
|
|
# won't be offline on a real device, so we only do this for emulators.
|
|
|
|
self.marionette.execute_script("""
|
|
|
|
Components.utils.import("resource://gre/modules/Services.jsm");
|
|
|
|
Services.io.manageOfflineStatus = false;
|
|
|
|
Services.io.offline = false;
|
|
|
|
""")
|
|
|
|
|
|
|
|
if os.path.isfile(self.test_script):
|
|
|
|
with open(self.test_script, 'r') as script:
|
|
|
|
self.marionette.execute_script(script.read(),
|
|
|
|
script_args=self.test_script_args)
|
|
|
|
else:
|
|
|
|
self.marionette.execute_script(self.test_script,
|
|
|
|
script_args=self.test_script_args)
|
2013-09-30 15:05:46 +00:00
|
|
|
status = self.runner.wait()
|
|
|
|
if status is None:
|
|
|
|
# the runner has timed out
|
|
|
|
status = 124
|
2013-07-26 18:40:04 +00:00
|
|
|
except KeyboardInterrupt:
|
|
|
|
log.info("runtests.py | Received keyboard interrupt.\n");
|
|
|
|
status = -1
|
|
|
|
except:
|
|
|
|
traceback.print_exc()
|
2013-09-19 12:20:17 +00:00
|
|
|
log.error("Automation Error: Received unexpected exception while running application\n")
|
2014-06-19 18:17:26 +00:00
|
|
|
if hasattr(self, 'runner'):
|
|
|
|
self.runner.check_for_crashes()
|
2013-07-26 18:40:04 +00:00
|
|
|
status = 1
|
|
|
|
|
2014-03-14 18:25:41 +00:00
|
|
|
self.stopServers()
|
2013-07-26 18:40:04 +00:00
|
|
|
|
|
|
|
log.info("runtestsb2g.py | Running tests: end.")
|
|
|
|
|
|
|
|
if manifest is not None:
|
|
|
|
self.cleanup(manifest, options)
|
|
|
|
return status
|
2012-04-27 18:44:59 +00:00
|
|
|
|
|
|
|
|
2014-06-16 18:51:22 +00:00
|
|
|
class B2GDeviceMochitest(B2GMochitest, Mochitest):
|
2014-06-19 18:17:26 +00:00
|
|
|
remote_log = None
|
2012-04-27 18:44:59 +00:00
|
|
|
|
2014-06-19 18:17:26 +00:00
|
|
|
def __init__(self, marionette_args, profile_data_dir,
|
2013-07-26 18:40:04 +00:00
|
|
|
local_binary_dir, remote_test_root=None, remote_log_file=None):
|
2014-06-19 18:17:26 +00:00
|
|
|
B2GMochitest.__init__(self, marionette_args, out_of_process=True, profile_data_dir=profile_data_dir)
|
2013-07-26 18:40:04 +00:00
|
|
|
self.local_log = None
|
|
|
|
self.local_binary_dir = local_binary_dir
|
2012-08-09 00:29:26 +00:00
|
|
|
|
2013-07-26 18:40:04 +00:00
|
|
|
def cleanup(self, manifest, options):
|
|
|
|
if self.local_log:
|
2014-06-19 18:17:26 +00:00
|
|
|
self.app_ctx.dm.getFile(self.remote_log, self.local_log)
|
|
|
|
self.app_ctx.dm.removeFile(self.remote_log)
|
2012-06-05 22:17:26 +00:00
|
|
|
|
2012-04-27 18:44:59 +00:00
|
|
|
if options.pidFile != "":
|
|
|
|
try:
|
|
|
|
os.remove(options.pidFile)
|
|
|
|
os.remove(options.pidFile + ".xpcshell.pid")
|
|
|
|
except:
|
|
|
|
print "Warning: cleaning up pidfile '%s' was unsuccessful from the test harness" % options.pidFile
|
|
|
|
|
2013-07-26 18:40:04 +00:00
|
|
|
# stop and clean up the runner
|
|
|
|
if getattr(self, 'runner', False):
|
2014-06-19 18:17:26 +00:00
|
|
|
if self.local_log:
|
|
|
|
self.app_ctx.dm.getFile(self.remote_log, self.local_log)
|
|
|
|
self.app_ctx.dm.removeFile(self.remote_log)
|
|
|
|
|
2013-07-26 18:40:04 +00:00
|
|
|
self.runner.cleanup()
|
|
|
|
self.runner = None
|
2012-04-27 18:44:59 +00:00
|
|
|
|
2014-03-14 18:25:41 +00:00
|
|
|
def startServers(self, options, debuggerInfo):
|
|
|
|
""" Create the servers on the host and start them up """
|
|
|
|
savedXre = options.xrePath
|
|
|
|
savedUtility = options.utilityPath
|
|
|
|
savedProfie = options.profilePath
|
|
|
|
options.xrePath = self.local_binary_dir
|
|
|
|
options.utilityPath = self.local_binary_dir
|
|
|
|
options.profilePath = tempfile.mkdtemp()
|
|
|
|
|
|
|
|
MochitestUtilsMixin.startServers(self, options, debuggerInfo)
|
2012-04-27 18:44:59 +00:00
|
|
|
|
2014-03-14 18:25:41 +00:00
|
|
|
options.xrePath = savedXre
|
|
|
|
options.utilityPath = savedUtility
|
|
|
|
options.profilePath = savedProfie
|
2012-04-27 18:44:59 +00:00
|
|
|
|
|
|
|
def buildURLOptions(self, options, env):
|
2013-07-26 18:40:04 +00:00
|
|
|
self.local_log = options.logFile
|
|
|
|
options.logFile = self.remote_log
|
2013-03-28 20:42:49 +00:00
|
|
|
options.profilePath = self.profile.profile
|
2014-06-16 18:51:22 +00:00
|
|
|
super(B2GDeviceMochitest, self).buildURLOptions(options, env)
|
2012-04-27 18:44:59 +00:00
|
|
|
|
2013-07-26 18:40:04 +00:00
|
|
|
self.setup_common_options(options)
|
2012-04-27 18:44:59 +00:00
|
|
|
|
2014-06-19 18:17:26 +00:00
|
|
|
options.profilePath = self.app_ctx.remote_profile
|
2013-07-26 18:40:04 +00:00
|
|
|
options.logFile = self.local_log
|
2012-04-27 18:44:59 +00:00
|
|
|
|
|
|
|
|
2013-08-14 17:57:43 +00:00
|
|
|
class B2GDesktopMochitest(B2GMochitest, Mochitest):
|
2013-01-04 18:41:34 +00:00
|
|
|
|
2014-06-19 18:17:26 +00:00
|
|
|
def __init__(self, marionette_args, profile_data_dir):
|
|
|
|
B2GMochitest.__init__(self, marionette_args, out_of_process=False, profile_data_dir=profile_data_dir)
|
2013-09-26 13:58:08 +00:00
|
|
|
Mochitest.__init__(self)
|
2014-03-14 18:25:41 +00:00
|
|
|
self.certdbNew = True
|
2013-01-04 18:41:34 +00:00
|
|
|
|
2013-08-14 17:57:43 +00:00
|
|
|
def runMarionetteScript(self, marionette, test_script, test_script_args):
|
2013-01-04 18:41:34 +00:00
|
|
|
assert(marionette.wait_for_port())
|
|
|
|
marionette.start_session()
|
|
|
|
marionette.set_context(marionette.CONTEXT_CHROME)
|
2013-08-14 17:57:43 +00:00
|
|
|
|
|
|
|
if os.path.isfile(test_script):
|
|
|
|
f = open(test_script, 'r')
|
|
|
|
test_script = f.read()
|
|
|
|
f.close()
|
|
|
|
self.marionette.execute_script(test_script,
|
|
|
|
script_args=test_script_args)
|
2013-01-04 18:41:34 +00:00
|
|
|
|
|
|
|
def startTests(self):
|
|
|
|
# This is run in a separate thread because otherwise, the app's
|
|
|
|
# stdout buffer gets filled (which gets drained only after this
|
|
|
|
# function returns, by waitForFinish), which causes the app to hang.
|
2014-06-19 18:17:26 +00:00
|
|
|
self.marionette = Marionette(**self.marionette_args)
|
2013-01-04 18:41:34 +00:00
|
|
|
thread = threading.Thread(target=self.runMarionetteScript,
|
2013-07-26 18:40:04 +00:00
|
|
|
args=(self.marionette,
|
2013-08-14 17:57:43 +00:00
|
|
|
self.test_script,
|
|
|
|
self.test_script_args))
|
2013-01-04 18:41:34 +00:00
|
|
|
thread.start()
|
|
|
|
|
|
|
|
def buildURLOptions(self, options, env):
|
2014-06-16 18:51:22 +00:00
|
|
|
super(B2GDesktopMochitest, self).buildURLOptions(options, env)
|
2013-01-04 18:41:34 +00:00
|
|
|
|
2013-07-26 18:40:04 +00:00
|
|
|
self.setup_common_options(options)
|
2013-01-04 18:41:34 +00:00
|
|
|
|
|
|
|
# Copy the extensions to the B2G bundles dir.
|
|
|
|
extensionDir = os.path.join(options.profilePath, 'extensions', 'staged')
|
|
|
|
bundlesDir = os.path.join(os.path.dirname(options.app),
|
|
|
|
'distribution', 'bundles')
|
|
|
|
|
|
|
|
for filename in os.listdir(extensionDir):
|
|
|
|
shutil.rmtree(os.path.join(bundlesDir, filename), True)
|
|
|
|
shutil.copytree(os.path.join(extensionDir, filename),
|
|
|
|
os.path.join(bundlesDir, filename))
|
|
|
|
|
2013-08-14 17:57:43 +00:00
|
|
|
def buildProfile(self, options):
|
|
|
|
return self.build_profile(options)
|
|
|
|
|
2013-01-04 18:41:34 +00:00
|
|
|
|
2013-07-26 18:40:04 +00:00
|
|
|
def run_remote_mochitests(parser, options):
|
2012-04-27 18:44:59 +00:00
|
|
|
# create our Marionette instance
|
2014-06-19 18:17:26 +00:00
|
|
|
marionette_args = {
|
|
|
|
'adb_path': options.adbPath,
|
|
|
|
'emulator': options.emulator,
|
|
|
|
'no_window': options.noWindow,
|
|
|
|
'logdir': options.logdir,
|
|
|
|
'busybox': options.busybox,
|
|
|
|
'symbols_path': options.symbolsPath,
|
|
|
|
'sdcard': options.sdcard,
|
|
|
|
'homedir': options.b2gPath,
|
|
|
|
}
|
2012-04-27 18:44:59 +00:00
|
|
|
if options.marionette:
|
2013-01-04 18:41:34 +00:00
|
|
|
host, port = options.marionette.split(':')
|
2014-06-19 18:17:26 +00:00
|
|
|
marionette_args['host'] = host
|
|
|
|
marionette_args['port'] = int(port)
|
2014-02-20 21:56:57 +00:00
|
|
|
|
2013-07-26 18:40:04 +00:00
|
|
|
options = parser.verifyRemoteOptions(options)
|
2012-04-27 18:44:59 +00:00
|
|
|
if (options == None):
|
|
|
|
print "ERROR: Invalid options specified, use --help for a list of valid options"
|
|
|
|
sys.exit(1)
|
|
|
|
|
2014-06-19 18:17:26 +00:00
|
|
|
mochitest = B2GDeviceMochitest(marionette_args, options.profile_data_dir, options.xrePath,
|
2013-07-26 18:40:04 +00:00
|
|
|
remote_log_file=options.remoteLogFile)
|
2012-04-27 18:44:59 +00:00
|
|
|
|
|
|
|
options = parser.verifyOptions(options, mochitest)
|
|
|
|
if (options == None):
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
retVal = 1
|
|
|
|
try:
|
2012-08-09 00:29:26 +00:00
|
|
|
mochitest.cleanup(None, options)
|
2013-07-26 18:40:04 +00:00
|
|
|
retVal = mochitest.run_tests(options)
|
2012-04-27 18:44:59 +00:00
|
|
|
except:
|
2012-11-05 13:03:55 +00:00
|
|
|
print "Automation Error: Exception caught while running tests"
|
2012-06-15 21:13:04 +00:00
|
|
|
traceback.print_exc()
|
2014-03-14 18:25:41 +00:00
|
|
|
mochitest.stopServers()
|
2012-04-27 18:44:59 +00:00
|
|
|
try:
|
|
|
|
mochitest.cleanup(None, options)
|
|
|
|
except:
|
|
|
|
pass
|
2012-11-20 15:24:28 +00:00
|
|
|
retVal = 1
|
2012-04-27 18:44:59 +00:00
|
|
|
|
|
|
|
sys.exit(retVal)
|
|
|
|
|
2013-01-04 18:41:34 +00:00
|
|
|
def run_desktop_mochitests(parser, options):
|
|
|
|
# create our Marionette instance
|
2014-06-19 18:17:26 +00:00
|
|
|
marionette_args = {}
|
2013-01-04 18:41:34 +00:00
|
|
|
if options.marionette:
|
|
|
|
host, port = options.marionette.split(':')
|
2014-06-19 18:17:26 +00:00
|
|
|
marionette_args['host'] = host
|
|
|
|
marionette_args['port'] = int(port)
|
|
|
|
mochitest = B2GDesktopMochitest(marionette_args, options.profile_data_dir)
|
2013-01-04 18:41:34 +00:00
|
|
|
|
2013-10-10 17:25:59 +00:00
|
|
|
# add a -bin suffix if b2g-bin exists, but just b2g was specified
|
|
|
|
if options.app[-4:] != '-bin':
|
|
|
|
if os.path.isfile("%s-bin" % options.app):
|
|
|
|
options.app = "%s-bin" % options.app
|
2013-01-04 18:41:34 +00:00
|
|
|
|
|
|
|
options = MochitestOptions.verifyOptions(parser, options, mochitest)
|
|
|
|
if options == None:
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
if options.desktop and not options.profile:
|
|
|
|
raise Exception("must specify --profile when specifying --desktop")
|
|
|
|
|
2014-03-11 20:22:34 +00:00
|
|
|
options.browserArgs += ['-marionette']
|
|
|
|
|
2013-07-26 18:40:04 +00:00
|
|
|
sys.exit(mochitest.runTests(options, onLaunch=mochitest.startTests))
|
2013-01-04 18:41:34 +00:00
|
|
|
|
|
|
|
def main():
|
2013-07-26 18:40:04 +00:00
|
|
|
parser = B2GOptions()
|
2013-01-04 18:41:34 +00:00
|
|
|
options, args = parser.parse_args()
|
|
|
|
|
|
|
|
if options.desktop:
|
|
|
|
run_desktop_mochitests(parser, options)
|
|
|
|
else:
|
2013-07-26 18:40:04 +00:00
|
|
|
run_remote_mochitests(parser, options)
|
2013-01-04 18:41:34 +00:00
|
|
|
|
2012-04-27 18:44:59 +00:00
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|