本文整理汇总了Python中mozrunner.utils.get_stack_fixer_function函数的典型用法代码示例。如果您正苦于以下问题:Python get_stack_fixer_function函数的具体用法?Python get_stack_fixer_function怎么用?Python get_stack_fixer_function使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_stack_fixer_function函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, logger, binary, prefs_root, test_type, extra_prefs=None, debug_info=None,
symbols_path=None, stackwalk_binary=None, certutil_binary=None,
ca_certificate_path=None, e10s=False, stackfix_dir=None,
binary_args=None, timeout_multiplier=None, leak_check=False, stylo_threads=1,
chaos_mode_flags=None, config=None):
Browser.__init__(self, logger)
self.binary = binary
self.prefs_root = prefs_root
self.test_type = test_type
self.extra_prefs = extra_prefs
self.marionette_port = None
self.runner = None
self.debug_info = debug_info
self.profile = None
self.symbols_path = symbols_path
self.stackwalk_binary = stackwalk_binary
self.ca_certificate_path = ca_certificate_path
self.certutil_binary = certutil_binary
self.e10s = e10s
self.binary_args = binary_args
self.config = config
if stackfix_dir:
self.stack_fixer = get_stack_fixer_function(stackfix_dir,
self.symbols_path)
else:
self.stack_fixer = None
if timeout_multiplier:
self.init_timeout = self.init_timeout * timeout_multiplier
self.leak_report_file = None
self.leak_check = leak_check
self.stylo_threads = stylo_threads
self.chaos_mode_flags = chaos_mode_flags
开发者ID:dfahlander,项目名称:web-platform-tests,代码行数:34,代码来源:firefox.py
示例2: runSerialTests
def runSerialTests(self, manifests, options, cmdlineArgs=None):
debuggerInfo = None
if options.debugger:
debuggerInfo = mozdebug.get_debugger_info(options.debugger, options.debuggerArgs,
options.debuggerInteractive)
profileDir = None
try:
if cmdlineArgs is None:
cmdlineArgs = []
profile = self.createReftestProfile(options, manifests)
profileDir = profile.profile # name makes more sense
# browser environment
browserEnv = self.buildBrowserEnv(options, profileDir)
status = self.runApp(profile,
binary=options.app,
cmdargs=cmdlineArgs,
# give the JS harness 30 seconds to deal with
# its own timeouts
env=browserEnv,
timeout=options.timeout + 30.0,
symbolsPath=options.symbolsPath,
options=options,
debuggerInfo=debuggerInfo)
mozleak.process_leak_log(self.leakLogFile,
leak_thresholds=options.leakThresholds,
stack_fixer=get_stack_fixer_function(options.utilityPath,
options.symbolsPath),
)
finally:
self.cleanup(profileDir)
return status
开发者ID:kitcambridge,项目名称:gecko-dev,代码行数:34,代码来源:runreftest.py
示例3: run_gtest
def run_gtest(self, prog, xre_path, cwd, symbols_path=None,
utility_path=None):
"""
Run a single C++ unit test program.
Arguments:
* prog: The path to the test program to run.
* env: The environment to use for running the program.
* cwd: The directory to run tests from (support files will be found
in this direcotry).
* symbols_path: A path to a directory containing Breakpad-formatted
symbol files for producing stack traces on crash.
* utility_path: A path to a directory containing utility programs.
currently used to locate a stack fixer to provide
symbols symbols for assertion stacks.
Return True if the program exits with a zero status, False otherwise.
"""
self.xre_path = xre_path
env = self.build_environment()
log.info("Running gtest")
if cwd and not os.path.isdir(cwd):
os.makedirs(cwd)
stream_output = mozprocess.StreamOutput(sys.stdout)
process_output = stream_output
if utility_path:
stack_fixer = get_stack_fixer_function(utility_path, symbols_path)
if stack_fixer:
process_output = lambda line: stream_output(stack_fixer(line))
proc = mozprocess.ProcessHandler([prog, "-unittest",
"--gtest_death_test_style=threadsafe"],
cwd=cwd,
env=env,
processOutputLine=process_output)
#TODO: After bug 811320 is fixed, don't let .run() kill the process,
# instead use a timeout in .wait() and then kill to get a stack.
proc.run(timeout=GTests.TEST_PROC_TIMEOUT,
outputTimeout=GTests.TEST_PROC_NO_OUTPUT_TIMEOUT)
proc.wait()
if proc.timedOut:
if proc.outputTimedOut:
log.testFail("gtest | timed out after %d seconds without output",
GTests.TEST_PROC_NO_OUTPUT_TIMEOUT)
else:
log.testFail("gtest | timed out after %d seconds",
GTests.TEST_PROC_TIMEOUT)
return False
if mozcrash.check_for_crashes(cwd, symbols_path, test_name="gtest"):
# mozcrash will output the log failure line for us.
return False
result = proc.proc.returncode == 0
if not result:
log.testFail("gtest | test failed with return code %d", proc.proc.returncode)
return result
开发者ID:luke-chang,项目名称:gecko-1,代码行数:58,代码来源:rungtests.py
示例4: __init__
def __init__(self, logger, binary, prefs_root, debug_info=None,
symbols_path=None, stackwalk_binary=None, certutil_binary=None,
ca_certificate_path=None, e10s=False, stackfix_dir=None):
Browser.__init__(self, logger)
self.binary = binary
self.prefs_root = prefs_root
self.marionette_port = None
self.runner = None
self.debug_info = debug_info
self.profile = None
self.symbols_path = symbols_path
self.stackwalk_binary = stackwalk_binary
self.ca_certificate_path = ca_certificate_path
self.certutil_binary = certutil_binary
self.e10s = e10s
if self.symbols_path and stackfix_dir:
self.stack_fixer = get_stack_fixer_function(stackfix_dir,
self.symbols_path)
else:
self.stack_fixer = None
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:20,代码来源:firefox.py
示例5: runSerialTests
def runSerialTests(self, testPath, options, cmdlineArgs=None):
debuggerInfo = None
if options.debugger:
debuggerInfo = mozdebug.get_debugger_info(options.debugger, options.debuggerArgs,
options.debuggerInteractive)
profileDir = None
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)
log.info("REFTEST INFO | runreftest.py | Running tests: start.\n")
status = self.runApp(profile,
binary=options.app,
cmdargs=cmdlineArgs,
# give the JS harness 30 seconds to deal with
# its own timeouts
env=browserEnv,
timeout=options.timeout + 30.0,
symbolsPath=options.symbolsPath,
options=options,
debuggerInfo=debuggerInfo)
mozleak.process_leak_log(self.leakLogFile,
leak_thresholds=options.leakThresholds,
log=log,
stack_fixer=get_stack_fixer_function(options.utilityPath,
options.symbolsPath),
)
log.info("\nREFTEST INFO | runreftest.py | Running tests: end.")
finally:
self.cleanup(profileDir)
return status
开发者ID:Jinwoo-Song,项目名称:gecko-dev,代码行数:38,代码来源:runreftest.py
示例6: run_tests
#.........这里部分代码省略.........
# option will happen later. So backup and restore options.manifestFile to
# prevent us from trying to pass in an instance of TestManifest via url param.
manifestFile = options.manifestFile
options.manifestFile = None
self.buildURLOptions(options, {'MOZ_HIDE_RESULTS_TABLE': '1'})
options.manifestFile = manifestFile
self.test_script_args.append(not options.emulator)
self.test_script_args.append(options.wifi)
self.test_script_args.append(options.chrome)
self.runner.start(outputTimeout=timeout)
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;
""")
self.marionette.execute_script("""
let SECURITY_PREF = "security.turn_off_all_security_so_that_viruses_can_take_over_this_computer";
Services.prefs.setBoolPref(SECURITY_PREF, true);
if (!testUtils.hasOwnProperty("specialPowersObserver")) {
let loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
loader.loadSubScript("chrome://specialpowers/content/SpecialPowersObserver.js",
testUtils);
testUtils.specialPowersObserver = new testUtils.SpecialPowersObserver();
testUtils.specialPowersObserver.init();
testUtils.specialPowersObserver._loadFrameScript();
}
""")
if options.chrome:
self.app_ctx.dm.removeDir(self.remote_chrome_test_dir)
self.app_ctx.dm.mkDir(self.remote_chrome_test_dir)
local = super(B2GMochitest, self).getChromeTestDir(options)
local = os.path.join(local, "chrome")
remote = self.remote_chrome_test_dir
self.log.info(
"pushing %s to %s on device..." %
(local, remote))
self.app_ctx.dm.pushDir(local, remote)
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)
status = self.runner.wait()
if status is None:
# the runner has timed out
status = 124
local_leak_file = tempfile.NamedTemporaryFile()
self.app_ctx.dm.getFile(
self.leak_report_file,
local_leak_file.name)
self.app_ctx.dm.removeFile(self.leak_report_file)
mozleak.process_leak_log(
local_leak_file.name,
leak_thresholds=options.leakThresholds,
ignore_missing_leaks=options.ignoreMissingLeaks,
log=self.log,
stack_fixer=get_stack_fixer_function(options.utilityPath,
options.symbolsPath),
)
except KeyboardInterrupt:
self.log.info("runtests.py | Received keyboard interrupt.\n")
status = -1
except:
traceback.print_exc()
self.log.error(
"Automation Error: Received unexpected exception while running application\n")
if hasattr(self, 'runner'):
self.runner.check_for_crashes()
status = 1
self.stopServers()
self.log.info("runtestsb2g.py | Running tests: end.")
if manifest is not None:
self.cleanup(manifest, options)
return status
开发者ID:DINKIN,项目名称:Waterfox,代码行数:101,代码来源:runtestsb2g.py
示例7: stack_fixer
def stack_fixer(self):
"""
return get_stack_fixer_function, if any, to use on the output lines
"""
return get_stack_fixer_function(self.utilityPath, self.symbolsPath)
开发者ID:Eroppo,项目名称:cyberfox-beta,代码行数:5,代码来源:runreftest.py
示例8: runSerialTests
def runSerialTests(self, manifests, options, cmdargs=None):
debuggerInfo = None
if options.debugger:
debuggerInfo = mozdebug.get_debugger_info(options.debugger, options.debuggerArgs,
options.debuggerInteractive)
profileDir = None
startAfter = None # When the previous run crashed, we skip the tests we ran before
prevStartAfter = None
for i in itertools.count():
try:
if cmdargs is None:
cmdargs = []
if self.use_marionette:
cmdargs.append('-marionette')
profile = self.createReftestProfile(options,
manifests,
startAfter=startAfter)
profileDir = profile.profile # name makes more sense
# browser environment
browserEnv = self.buildBrowserEnv(options, profileDir)
self.log.info("Running with e10s: {}".format(options.e10s))
status, startAfter = self.runApp(profile,
binary=options.app,
cmdargs=cmdargs,
env=browserEnv,
# We generally want the JS harness or marionette
# to handle timeouts if they can.
# The default JS harness timeout is currently
# 300 seconds (default options.timeout).
# The default Marionette socket timeout is
# currently 360 seconds.
# Give the JS harness extra time to deal with
# its own timeouts and try to usually exceed
# the 360 second marionette socket timeout.
# See bug 479518 and bug 1414063.
timeout=options.timeout + 70.0,
symbolsPath=options.symbolsPath,
options=options,
debuggerInfo=debuggerInfo)
self.log.info("Process mode: {}".format('e10s' if options.e10s else 'non-e10s'))
mozleak.process_leak_log(self.leakLogFile,
leak_thresholds=options.leakThresholds,
stack_fixer=get_stack_fixer_function(options.utilityPath,
options.symbolsPath))
if status == 0:
break
if startAfter == self.TEST_SEEN_FINAL:
self.log.info("Finished running all tests, skipping resume "
"despite non-zero status code: %s" % status)
break
if startAfter is not None and options.shuffle:
self.log.error("Can not resume from a crash with --shuffle "
"enabled. Please consider disabling --shuffle")
break
if startAfter is not None and options.maxRetries <= i:
self.log.error("Hit maximum number of allowed retries ({}) "
"in the test run".format(options.maxRetries))
break
if startAfter == prevStartAfter:
# If the test stuck on the same test, or there the crashed
# test appeared more then once, stop
self.log.error("Force stop because we keep running into "
"test \"{}\"".format(startAfter))
break
prevStartAfter = startAfter
# TODO: we need to emit an SUITE-END log if it crashed
finally:
self.cleanup(profileDir)
return status
开发者ID:luke-chang,项目名称:gecko-1,代码行数:76,代码来源:runreftest.py
示例9: __init__
def __init__(self, log, utilityPath, symbolsPath=None):
self.stack_fixer_function = get_stack_fixer_function(utilityPath, symbolsPath)
self.log = log
# needed for b2gautomation.py
self.suite_finished = False
开发者ID:MekliCZ,项目名称:positron,代码行数:5,代码来源:output.py
注:本文中的mozrunner.utils.get_stack_fixer_function函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论