当前位置: 首页>>代码示例>>Python>>正文


Python OPTIONS.parse_configure_file方法代码示例

本文整理汇总了Python中build_options.OPTIONS.parse_configure_file方法的典型用法代码示例。如果您正苦于以下问题:Python OPTIONS.parse_configure_file方法的具体用法?Python OPTIONS.parse_configure_file怎么用?Python OPTIONS.parse_configure_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在build_options.OPTIONS的用法示例。


在下文中一共展示了OPTIONS.parse_configure_file方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _process_args

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import parse_configure_file [as 别名]
def _process_args(raw_args):
  args = parse_args(raw_args)
  logging.basicConfig(
      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_options(args)
  set_test_config_flags(args)
  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
开发者ID:NaiveTorch,项目名称:ARC,代码行数:37,代码来源:run_integration_tests.py

示例2: main

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import parse_configure_file [as 别名]
def main():
  # We reuse scripts for integration tests in opaque and vm, and they expect
  # that out/integration_tests exists. It is true if integration tests ran
  # before calling perf_test.py, but not true for perf builders.
  # Let's create it if it does not exist.
  build_common.makedirs_safely(SuiteRunnerBase.get_output_directory())

  OPTIONS.parse_configure_file()
  parser = argparse.ArgumentParser(
      description=__doc__,
      formatter_class=argparse.RawTextHelpFormatter)
  parser.add_argument('mode', choices=_TEST_CLASS_MAP.keys())
  parser.add_argument('--iterations', default=20, type=int,
                      help=('Number of iterations to run after warmup phase. '
                            'The default is 20.'))
  parser.add_argument('--test-mode', action='store_true',
                      help='Test mode. Parse %s and exit.' % _OUTPUT_LOG_FILE)
  parser.add_argument('--verbose', '-v', action='store_true',
                      help='Verbose mode')

  remote_executor.add_remote_arguments(parser)

  args = parser.parse_args()

  _set_logging_level(args)

  clazz = create_test_class(args.mode)
  clazz(args).main()
开发者ID:NaiveTorch,项目名称:ARC,代码行数:30,代码来源:perf_test.py

示例3: main

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import parse_configure_file [as 别名]
def main():
  OPTIONS.parse_configure_file()
  args = _parse_args()
  if args.mode == 'stackwalk':
    _stackwalk(args.minidump)
  elif args.mode == 'dump':
    _dump(args.minidump)
开发者ID:NaiveTorch,项目名称:ARC,代码行数:9,代码来源:breakpad.py

示例4: main

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import parse_configure_file [as 别名]
def main():
  OPTIONS.parse_configure_file()

  libs = []
  for lib in android_static_libraries.get_android_static_library_deps():
    assert lib.endswith('.a')
    lib = os.path.splitext(lib)[0]

    # Strip unnecessary suffixes (e.g., libjpeg_static).
    for unnecessary_suffix in ['_static', '_fake']:
      if lib.endswith(unnecessary_suffix):
        lib = lib[:-len(unnecessary_suffix)]
    libs.append(lib)

  # We are not building android/frameworks/native/opengl/libs/GLES2.
  # As libGLESv2.so is just a wrapper of real GL implementations, GL
  # related symbols linked in the main nexe work as symbols in
  # libGLESv2.so.
  libs.append('libGLESv2')

  # Graphics translation builds all EGL/GLES libraries as static libraries
  # so we need to register them here so that they can still be dlopen'ed.
  if not OPTIONS.enable_emugl():
    libs.append('libEGL')
    libs.append('libEGL_emulation')
    libs.append('libGLESv1_CM')
    libs.append('libGLESv2_emulation')

  libs_string_literals = ['  "%s",' % lib for lib in libs]

  sys.stdout.write(_ANDROID_STATIC_LIBRARIES_TEMPLATE.substitute({
      'ANDROID_STATIC_LIBRARIES': '\n'.join(libs_string_literals)
  }))
开发者ID:NaiveTorch,项目名称:ARC,代码行数:35,代码来源:gen_android_static_libraries_cc.py

示例5: main

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from 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()
开发者ID:NaiveTorch,项目名称:ARC,代码行数:11,代码来源:crash_analyzer.py

示例6: main

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from 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)
  }))
开发者ID:NaiveTorch,项目名称:ARC,代码行数:12,代码来源:gen_wrapped_functions_cc.py

示例7: main

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from 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
开发者ID:NaiveTorch,项目名称:ARC,代码行数:57,代码来源:symbol_tool.py

示例8: main

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import parse_configure_file [as 别名]
def main():
  description = ('Runs multiple APKs and indicates how many succeed or '
                 'fail and with what failure modes.')
  parser = argparse.ArgumentParser(description=description)
  parser.add_argument('-j', '--jobs', metavar='N', default=1, type=int,
                      help='Run N tests at once.')
  parser.add_argument('--launch-chrome-opt', action='append', default=[],
                      dest='launch_chrome_opts', metavar='OPTIONS',
                      help=('An Option to pass on to launch_chrome. Repeat as '
                            'needed for any options to pass on.'))
  parser.add_argument('--minimum-lifetime', type=int, default=0,
                      metavar='<T>', help='This flag will be passed to '
                      'launch_chrome to control the behavior after onResume. '
                      'This requires the application to continue running T '
                      'seconds.')
  parser.add_argument('--minimum-steady', type=int, default=0,
                      metavar='<T>', help='This flag will be passed to '
                      'launch_chrome to control the behavior after onResume. '
                      'This requires the application to continue running T '
                      'seconds with no output.')
  parser.add_argument('--noninja', action='store_false',
                      default=True, dest='run_ninja',
                      help='Do not run ninja before running any tests.')
  parser.add_argument('--timeout', metavar='T', default=60, type=int,
                      help='Timeout value for onResume. Once onResume '
                      'fires, --minimum-lifetime and --minimum-steady '
                      'determine when the application is considered '
                      'successfully running.')
  parser.add_argument('--show-known-java-exceptions', action='store_true',
                      help='Show the known Java exceptions if this flag '
                      'is specified.')
  parser.add_argument('--tsv', metavar='TSV', help='Output results in TSV to '
                      'the file specified by this argument.')
  parser.add_argument('apks', metavar='apk', nargs='*',
                      help='Filenames of APKs.')
  remote_executor.add_remote_arguments(parser)

  args = parser.parse_args()

  OPTIONS.parse_configure_file()

  if args.run_ninja:
    build_common.run_ninja()

  if not os.path.exists(_OUT_DIR):
    os.mkdir(_OUT_DIR)

  sys.stdout.write('=== Results ===\n')
  results = _test_apks_boot(args)
  sys.stdout.write('\n')
  _show_stats(results)
  if args.tsv:
    _output_tsv(results, args.tsv)
开发者ID:NaiveTorch,项目名称:ARC,代码行数:55,代码来源:test_apks_boot.py

示例9: main

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import parse_configure_file [as 别名]
def main():
  _setup_sigterm_handler()

  OPTIONS.parse_configure_file()

  parsed_args = launch_chrome_options.parse_args(sys.argv)

  _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)
  set_environment_for_chrome()

  if not platform_util.is_running_on_remote_host():
    _check_apk_existence(parsed_args)

  # Do not build crx for drive by mode.
  # TODO(crbug.com/326724): Transfer args to metadata in driveby mode.
  if parsed_args.mode != 'driveby':
    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
开发者ID:NaiveTorch,项目名称:ARC,代码行数:54,代码来源:launch_chrome.py

示例10: main

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from 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

  test_runner = BionicFundamentalTestRunner()
  test_runner.run()

  if not test_runner.is_ok():
    return 1

  return 0
开发者ID:NaiveTorch,项目名称:ARC,代码行数:17,代码来源:run_bionic_fundamental_tests.py

示例11: main

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from 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]
  lib_name = os.path.basename(android_lib)

  android_syms = get_defined_symbols(android_lib)
  arc_syms = get_defined_symbols(arc_lib)

  # Explicitly check if ldexp exists in libc.so, as we allow the
  # absence of ldexp in libm.so. See also the comment for libm.so in
  # _WHITELISTS.
  if lib_name == 'libc.so' and 'ldexp' not in arc_syms:
    logging.error('ldexp must be in libc.so')
    return 1

  missing_syms = set(android_syms - arc_syms)

  whitelist = set(_WHITELISTS.get(lib_name, []))

  unused_whitelist = whitelist - missing_syms
  if unused_whitelist:
    logging.error('%s is whitelisted, but it is defined in %s. '
                  'Update _WHITELISTS' % (whitelist, arc_lib))
    return 1

  missing_syms -= whitelist

  # Most symbols starting with an underscore are internal symbols,
  # but the ones starting with '_Z' are mangled C++ symbols.
  important_missing_syms = [
      sym for sym in missing_syms
      if not sym.startswith('_') or sym.startswith('_Z')]

  if important_missing_syms:
    for sym in sorted(important_missing_syms):
      logging.error('Missing symbol: %s' % sym)
    return 1
  return 0
开发者ID:NaiveTorch,项目名称:ARC,代码行数:47,代码来源:check_symbols.py

示例12: main

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import parse_configure_file [as 别名]
def main():
  OPTIONS.parse_configure_file()

  if len(sys.argv) < 3:
    print 'Usage: %s arc.nexe libc.so...'
    return 1

  arc_nexe = sys.argv[1]
  libc_libraries = sys.argv[2:]
  functions = set(wrapped_functions.get_wrapped_functions())

  ok = _check_wrapper_functions_are_defined(functions, arc_nexe)
  ok = ok & _check_wrapped_functions_are_defined(functions, libc_libraries)
  if not ok:
    print 'FAILED'
    return 1
  print 'OK'
  return 0
开发者ID:NaiveTorch,项目名称:ARC,代码行数:20,代码来源:check_wrapped_functions_integrity.py

示例13: main

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import parse_configure_file [as 别名]
def main():
  OPTIONS.parse_configure_file()
  test_args = sys.argv[1:]
  if not test_args:
    print 'Usage: %s test_binary [test_args...]' % sys.argv[0]
    sys.exit(1)

  # This script must not die by Ctrl-C while GDB is running. We simply
  # ignore SIGINT. Note that GDB will still handle Ctrl-C properly
  # because GDB sets its signal handler by itself.
  signal.signal(signal.SIGINT, signal.SIG_IGN)

  runner_args = toolchain.get_tool(OPTIONS.target(), 'runner').split()
  if OPTIONS.is_nacl_build():
    _run_gdb_for_nacl(runner_args, test_args)
  elif OPTIONS.is_bare_metal_build():
    if OPTIONS.is_arm():
      _run_gdb_for_bare_metal_arm(runner_args, test_args)
    else:
      _run_gdb_for_bare_metal(runner_args, test_args)
开发者ID:NaiveTorch,项目名称:ARC,代码行数:22,代码来源:run_under_gdb.py

示例14:

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import parse_configure_file [as 别名]
# found in the LICENSE file.
#
# These build properties are usually created by the Android makefile
# system.  Specifically the ro.build.version info is written by
# $ANDROID/build/tools/buildinfo.sh whose variables are set by
# $ANDROID/build/core/version_defaults.mk and various build_id.mk
# files.


import os
import subprocess

import build_common
from build_options import OPTIONS

OPTIONS.parse_configure_file()


# Environment variables below are sorted alphabetically.

# version_defaults.mk sets this if there is no BUILD_ID set.
_BUILD_NUMBER = build_common.get_build_version()

os.environ['BUILD_DISPLAY_ID'] = _BUILD_NUMBER

# Non-tagged builds generate fingerprints that are longer than the maximum of 92
# characters allowed for system property values. Split the build ID in version
# and specific build to be within the limit.
if '-' in _BUILD_NUMBER:
  tokens = _BUILD_NUMBER.split('-')
  os.environ['BUILD_ID'] = tokens[0]
开发者ID:NaiveTorch,项目名称:ARC,代码行数:33,代码来源:generate_build_prop.py


注:本文中的build_options.OPTIONS.parse_configure_file方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。