本文整理汇总了Python中src.build.build_options.OPTIONS.parse_configure_file方法的典型用法代码示例。如果您正苦于以下问题:Python OPTIONS.parse_configure_file方法的具体用法?Python OPTIONS.parse_configure_file怎么用?Python OPTIONS.parse_configure_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类src.build.build_options.OPTIONS
的用法示例。
在下文中一共展示了OPTIONS.parse_configure_file方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import parse_configure_file [as 别名]
def main():
OPTIONS.parse_configure_file()
target = OPTIONS.target()
regular_expectations = _get_expectations()
large_expectations = _get_expectations(["--include-large"])
for botname in os.listdir(_BOTLOGS_DIR):
if not botname.replace("-", "_").startswith(target):
continue
botdir = os.path.join(_BOTLOGS_DIR, botname)
lognames = [os.path.join(botdir, filename) for filename in os.listdir(botdir)]
failures, incompletes = _parse(lognames)
top_flake = sorted([(freq, name) for name, freq in failures.iteritems()], reverse=True)
print "%s:" % botname
if "large_tests" in botname:
expectations = large_expectations
else:
expectations = regular_expectations
for freq, name in top_flake:
assert name in expectations, "%s is not in expectations list" % name
run, flags = expectations[name]
if run == "SKIP":
continue
failrate = 100.0 * freq / float(len(lognames))
print "%5.2f%% fail rate [%-4s %-19s] %s" % (failrate, run, ",".join(flags), name)
print
return 0
示例2: main
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import parse_configure_file [as 别名]
def main():
OPTIONS.parse_configure_file()
logging.getLogger().setLevel(logging.INFO)
if len(sys.argv) != 3:
logging.fatal('Usage: %s android-lib.so arc-lib.so' % sys.argv[0])
return 1
android_lib = sys.argv[1]
arc_lib = sys.argv[2]
android_syms = get_defined_symbols(android_lib)
arc_syms = get_defined_symbols(arc_lib)
missing_syms = set(android_syms - arc_syms)
# Ignore symbols starting with two underscores since they are internal ones.
# However, we do not ignore symbols starting with one underscore so that the
# script can check symbols such as _Zxxx (mangled C++ symbols), _setjmp, and
# _longjmp.
important_missing_syms = [
sym for sym in missing_syms if not sym.startswith('__')]
if important_missing_syms:
for sym in sorted(important_missing_syms):
logging.error('Missing symbol: %s' % sym)
return 1
return 0
示例3: main
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import parse_configure_file [as 别名]
def main(args):
OPTIONS.parse_configure_file()
# TODO(crbug.com/378196): Make qemu-arm available in open source in order to
# run any unit tests there.
if open_source.is_open_source_repo() and OPTIONS.is_arm():
return 0
for test_name in args[1:]:
pipe = subprocess.Popen(['python', 'src/build/run_unittest.py',
test_name],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
out = pipe.communicate()[0]
sys.stdout.write(out)
if pipe.returncode:
sys.stdout.write('FAIL (exit=%d)\n' % pipe.returncode)
sys.stdout.write(out + '\n')
return 1
elif out.find('PASS\n') < 0:
sys.stdout.write('FAIL (no PASS)\n')
sys.stdout.write(out + '\n')
return 1
else:
sys.stdout.write('OK\n')
return 0
示例4: _process_args
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import parse_configure_file [as 别名]
def _process_args(raw_args):
args = parse_args(raw_args)
logging_util.setup(
level=logging.DEBUG if args.output == 'verbose' else logging.WARNING)
OPTIONS.parse_configure_file()
# Limit to one job at a time when running a suite multiple times. Otherwise
# suites start interfering with each others operations and bad things happen.
if args.repeat_runs > 1:
args.jobs = 1
if args.buildbot and OPTIONS.weird():
args.exclude_patterns.append('cts.*')
# Fixup all patterns to at least be a prefix match for all tests.
# This allows options like "-t cts.CtsHardwareTestCases" to work to select all
# the tests in the suite.
args.include_patterns = [(pattern if '*' in pattern else (pattern + '*'))
for pattern in args.include_patterns]
args.exclude_patterns = [(pattern if '*' in pattern else (pattern + '*'))
for pattern in args.exclude_patterns]
set_test_global_state(args)
if (not args.remote and args.buildbot and
not platform_util.is_running_on_cygwin()):
print_chrome_version()
if platform_util.is_running_on_remote_host():
args.run_ninja = False
return args
示例5: run
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import parse_configure_file [as 别名]
def run():
OPTIONS.parse_configure_file()
# Check if internal/ exists. Run git-clone if not.
if not os.path.isdir(_ARC_INTERNAL_DIR):
# TODO(tandrii): Move this nacl-x86_64-bionic-internal recipe's botupdate
# step.
url = 'https://chrome-internal.googlesource.com/arc/internal-packages.git'
logging.info('Cloning %s' % url)
subprocess.check_call('git clone %s internal' % url,
cwd=_ARC_ROOT, shell=True)
# On 'internal' mode, sync the HEAD to the DEPS revision.
# On 'internal-dev', just use the current HEAD.
if OPTIONS.internal_apks_source() == 'internal':
# Check if internal/ is clean and on master.
if _git_has_local_modification():
logging.error('%s has local modification' % _ARC_INTERNAL_DIR)
sys.exit(-1)
# Check if internal/ is up to date. Run git-reset if not.
with open(_DEPS_FILE) as f:
target_revision = f.read().rstrip()
logging.info('%s has %s' % (_DEPS_FILE, target_revision))
if target_revision != _get_current_arc_int_revision():
sync_repo(target_revision)
# Run the configuration for the current HEAD revision. This steps includes
# syncing internal/third_party/ repositories when needed.
subprocess.check_call(os.path.join(_ARC_INTERNAL_DIR, 'build/configure.py'))
return 0
示例6: main
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import parse_configure_file [as 别名]
def main():
args = _parse_args()
logging_util.setup()
OPTIONS.parse_configure_file()
if args.mode == 'stackwalk':
_stackwalk(args.minidump)
elif args.mode == 'dump':
_dump(args.minidump)
示例7: main
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import parse_configure_file [as 别名]
def main():
OPTIONS.parse_configure_file()
args = _parse_args()
for arg in args.target_files:
with open(arg) as f:
analyzer = CrashAnalyzer(is_annotating=args.annotate)
for line in f:
if analyzer.handle_line(line):
print analyzer.get_crash_report()
示例8: main
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import parse_configure_file [as 别名]
def main():
OPTIONS.parse_configure_file()
functions = []
for function in wrapped_functions.get_wrapped_functions():
functions.append(' { "%s", reinterpret_cast<void*>(%s) },' %
(function, function))
sys.stdout.write(_WRAPPED_FUNCTIONS_CC_TEMPLATE.substitute({
'WRAPPED_FUNCTIONS': '\n'.join(functions)
}))
示例9: main
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import parse_configure_file [as 别名]
def main():
description = 'Tool to manipulate symbol list files.'
parser = argparse.ArgumentParser(description=description)
parser.add_argument(
'--dump-defined', action='store_true',
help='Dump defined symbols from the given shared object.')
parser.add_argument(
'--dump-undefined', action='store_true',
help='Dump defined symbols from the given shared object.')
parser.add_argument(
'--clean', action='store_true',
help='Copy symbols file with comments stripped.')
parser.add_argument(
'--verify', action='store_true',
help='Verify that file 1 does not contain symbols listed in file 2.')
parser.add_argument('args', nargs=argparse.REMAINDER)
args = parser.parse_args()
OPTIONS.parse_configure_file()
nm = toolchain.get_tool(OPTIONS.target(), 'nm')
if args.dump_defined:
command = (nm + ' --defined-only --extern-only --format=posix %s | '
'sed -n \'s/^\(.*\) [A-Za-z].*$/\\1/p\' | '
'LC_ALL=C sort -u' % args.args[0])
return subprocess.check_call(command, shell=True)
elif args.dump_undefined:
command = (nm + ' --undefined-only --format=posix %s | '
'sed -n \'s/^\(.*\) U.*$/\\1/p\' | '
'LC_ALL=C sort -u' % args.args[0])
return subprocess.check_call(command, shell=True)
elif args.clean:
command = ('egrep -ve "^#" %s | LC_ALL=C sort' % args.args[0])
return subprocess.check_call(command, shell=True)
elif args.verify:
command = ('LC_ALL=C comm -12 %s %s' % (args.args[0], args.args[1]))
try:
diff = subprocess.check_output(command, shell=True,
stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
# This can happen if files are not sorted
print e.output.rstrip()
return 1
if diff:
print '%s has disallowed symbols: ' % (args.args[0])
print diff.rstrip()
return 1
return 0
print 'No command specified.'
return 1
示例10: main
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import parse_configure_file [as 别名]
def main():
signal_util.setup()
OPTIONS.parse_configure_file()
parsed_args = launch_chrome_options.parse_args(sys.argv)
logging_util.setup(
level=logging.DEBUG if parsed_args.verbose else logging.INFO)
_prepare_chrome_user_data_dir(parsed_args)
global _CHROME_PID_PATH
_CHROME_PID_PATH = os.path.join(_USER_DATA_DIR, 'chrome.pid')
# If there is an X server at :0.0 and GPU is enabled, set it as the
# current display.
if parsed_args.display:
os.environ['DISPLAY'] = parsed_args.display
os.chdir(_ROOT_DIR)
if not parsed_args.remote:
_kill_running_chrome()
if parsed_args.run_ninja:
build_common.run_ninja()
ld_library_path = os.environ.get('LD_LIBRARY_PATH')
lib_paths = ld_library_path.split(':') if ld_library_path else []
lib_paths.append(build_common.get_load_library_path())
# Add the directory of the chrome binary so that .so files in the directory
# can be loaded. This is needed for loading libudev.so.0.
# TODO(crbug.com/375609): Remove the hack once it becomes no longer needed.
lib_paths.append(os.path.dirname(_get_chrome_path(parsed_args)))
os.environ['LD_LIBRARY_PATH'] = ':'.join(lib_paths)
launch_chrome_util.set_environment_for_chrome()
if not platform_util.is_running_on_remote_host():
_check_apk_existence(parsed_args)
if not platform_util.is_running_on_remote_host():
prep_launch_chrome.prepare_crx(parsed_args)
prep_launch_chrome.remove_crx_at_exit_if_needed(parsed_args)
if parsed_args.remote:
remote_executor.launch_remote_chrome(parsed_args, sys.argv[1:])
else:
platform_util.assert_machine(OPTIONS.target())
_check_crx_existence(parsed_args)
_run_chrome_iterations(parsed_args)
return 0
示例11: main
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import parse_configure_file [as 别名]
def main(args):
OPTIONS.parse_configure_file()
if len(args) != 3:
return -1
target = args[0]
input_so_path = args[1]
output_toc_path = args[2]
toc = make_table_of_contents(target, input_so_path)
if should_update_toc_file(toc, output_toc_path):
file_util.write_atomically(output_toc_path, toc)
return 0
示例12: main
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import parse_configure_file [as 别名]
def main():
OPTIONS.parse_configure_file()
parser = argparse.ArgumentParser(
description='Apply dex2oat to sub apks contained as assets in GmsCore.')
parser.add_argument('--input', required=True, help='input apk')
parser.add_argument('--output', required=True, help='output apk')
args = parser.parse_args()
work_dir = tempfile.mkdtemp()
try:
return 0 if _preoptimize_subapk(args.input, args.output, work_dir) else 1
finally:
file_util.rmtree(work_dir)
示例13: main
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import parse_configure_file [as 别名]
def main():
OPTIONS.parse_configure_file()
print '''// Auto-generated file - DO NOT EDIT!
// THIS FILE SHOULD BE USED FOR UNIT TESTS ONLY.
#if defined(__native_client__) && defined(__i386__)
.type get_pc_thunk_cx, function
get_pc_thunk_cx:
popl %ecx
nacljmp %ecx
#endif
.macro trampoline_to_original_libc_call function
#if defined(__native_client__)
#if defined(__i386__)
call get_pc_thunk_cx
addl $_GLOBAL_OFFSET_TABLE_, %ecx
movl \\[email protected](%ecx), %ecx
nacljmp %ecx
#elif defined(__x86_64__)
jmp \\[email protected]
#else
#error "Unsupported NaCl architecture"
#endif
#else // defined(__native_client__)
#if defined(__i386__)
jmp \\function
#elif defined(__arm__)
b \\function
#else
#error "Unsupported architecture"
#endif
#endif
.endm
.macro define_wrap_function_to_call_original_function function
.globl __wrap_\\function
.type __wrap_\\function, function
#if defined(__native_client__)
.balign 32
#endif // defined(__native_client__)
__wrap_\\function:
trampoline_to_original_libc_call \\function
.endm
'''
for name in wrapped_functions.get_wrapped_functions():
print 'define_wrap_function_to_call_original_function %s' % name
示例14: main
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import parse_configure_file [as 别名]
def main():
OPTIONS.parse_configure_file()
parser = argparse.ArgumentParser(
usage=os.path.basename(sys.argv[0]) + ' <options> apks...',
formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('--symlink-dir',
help='Symlink the bare APK to latest version')
parser.add_argument('--dry-run', '-n', action='store_true',
help='Only print what would be run')
parser.add_argument('apks', nargs='*', help=argparse.SUPPRESS)
opts = parser.parse_args(sys.argv[1:])
if not opts.apks:
print 'Specify at least one APK file'
sys.exit(1)
_rename(opts)
示例15: main
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import parse_configure_file [as 别名]
def main():
OPTIONS.parse_configure_file()
parser = argparse.ArgumentParser()
parser.add_argument('input', nargs='?',
type=argparse.FileType('r'),
default='chrometrace.log')
parser.add_argument('output', nargs='?',
type=argparse.FileType('w'),
default='expanded_chrometrace.log')
parser.add_argument('--logtag', type=argparse.FileType('r'),
default=os.path.join(build_common.get_android_root(),
'etc', 'event-log-tags'))
options = parser.parse_args(sys.argv[1:])
trace = json.load(options.input)
logtag_format = re.compile(r'(\d+) (\S+) .*')
logtags = collections.defaultdict(LogTag)
for line in options.logtag.readlines():
m = logtag_format.match(line)
if m:
logtags[int(m.group(1))].name = m.group(2)
for i in xrange(len(trace)):
entry = trace[i]
if entry['cat'] == 'ARC' and entry['name'] == 'EventLogTag':
if 'args' not in entry or 'tag' not in entry['args']:
entry['name'] = 'Poorly formatted EventLogTag'
print 'Invalid eventlogtag: %s' % entry
else:
number = entry['args']['tag']
if number not in logtags:
entry['name'] = 'Unknown EventLogTag'
print 'Unknown eventlogtag: %s' % entry
else:
entry['name'] = logtags[number].name + " (EventLogTag)"
options.output.write(json.dumps(trace, separators=(',', ':')))
print 'Done'
return 0