• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python build_options.OPTIONS类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: main

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
开发者ID:epowers,项目名称:arc,代码行数:27,代码来源:run_bionic_fundamental_test.py


示例2: main

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
开发者ID:epowers,项目名称:arc,代码行数:28,代码来源:check_symbols.py


示例3: _stub_parse_configure_file

def _stub_parse_configure_file():
  """A helper function for trapping calls to read the build options file.

  Populate them with the default build configuration instead, so this test
  behaves the same regardless of the actual configuration.
  """
  OPTIONS.parse([])
开发者ID:epowers,项目名称:arc,代码行数:7,代码来源:run_integration_tests_test.py


示例4: _generate_shared_lib_depending_ninjas

def _generate_shared_lib_depending_ninjas(ninja_list):
  timer = build_common.SimpleTimer()

  timer.start('Generating plugin and packaging ninjas', OPTIONS.verbose())
  # We must generate plugin/nexe ninjas after make->ninja lazy generation
  # so that we have the full list of production shared libraries to
  # pass to the load test.
  # These modules depend on shared libraries generated in the previous phase.
  production_shared_libs = (
      ninja_generator.NinjaGenerator.get_production_shared_libs(ninja_list[:]))
  generator_list = list(_list_ninja_generators(
      _config_loader, 'generate_shared_lib_depending_ninjas'))

  if OPTIONS.run_tests():
    generator_list.extend(_list_ninja_generators(
        _config_loader, 'generate_shared_lib_depending_test_ninjas'))

  result_list = ninja_generator_runner.run_in_parallel(
      [ninja_generator_runner.GeneratorTask(
          config_context,
          (generator, production_shared_libs))
       for config_context, generator in generator_list],
      OPTIONS.configure_jobs())
  ninja_list = []
  for config_result in result_list:
    ninja_list.extend(config_result.generated_ninjas)
  ninja_list.sort(key=lambda ninja: ninja.get_module_name())

  timer.done()
  return ninja_list
开发者ID:epowers,项目名称:arc,代码行数:30,代码来源:config_runner.py


示例5: generate_ninjas

def generate_ninjas():
  needs_clobbering, cache_to_save = _set_up_generate_ninja()
  ninja_list, independent_ninja_cache = _generate_independent_ninjas(
      needs_clobbering)
  cache_to_save.extend(independent_ninja_cache)
  ninja_list.extend(
      _generate_shared_lib_depending_ninjas(ninja_list))
  ninja_list.extend(_generate_dependent_ninjas(ninja_list))

  top_level_ninja = _generate_top_level_ninja(ninja_list)
  ninja_list.append(top_level_ninja)

  # Run verification before emitting to files.
  _verify_ninja_generator_list(ninja_list)

  # Emit each ninja script to a file.
  timer = build_common.SimpleTimer()
  timer.start('Emitting ninja scripts', OPTIONS.verbose())
  for ninja in ninja_list:
    ninja.emit()
  top_level_ninja.emit_depfile()
  top_level_ninja.cleanup_out_directories(ninja_list)
  timer.done()

  if OPTIONS.enable_config_cache():
    for cache_object, cache_path in cache_to_save:
      cache_object.save_to_file(cache_path)
开发者ID:epowers,项目名称:arc,代码行数:27,代码来源:config_runner.py


示例6: _filter_params_for_v8

def _filter_params_for_v8(vars):
  # Switch V8 to always emit ARM code and use simulator to run that on
  # x86 NaCl.
  # Also disable snapshots as they are not working in ARC yet.
  if OPTIONS.is_nacl_build():
    if '-DV8_TARGET_ARCH_IA32' in vars.get_cflags():
      vars.get_cflags().remove('-DV8_TARGET_ARCH_IA32')
    if '-DV8_TARGET_ARCH_X64' in vars.get_cflags():
      vars.get_cflags().remove('-DV8_TARGET_ARCH_X64')
    vars.get_cflags().append('-DV8_TARGET_ARCH_ARM')
    vars.get_cflags().append('-D__ARM_ARCH_7__')
  sources = vars.get_sources()
  new_sources = []
  v8_src = 'android/external/chromium_org/v8/src/'
  for path in sources:
    if OPTIONS.is_nacl_build():
      if path.startswith(v8_src + 'x64/'):
        path = v8_src + 'arm/' + os.path.basename(path).replace('x64', 'arm')
      if path.startswith(v8_src + 'ia32/'):
        path = v8_src + 'arm/' + os.path.basename(path).replace('ia32', 'arm')
    if path.endswith('/snapshot.cc'):
      path = 'android/external/chromium_org/v8/src/snapshot-empty.cc'
    new_sources.append(path)
  if not OPTIONS.is_arm() and OPTIONS.is_nacl_build():
    new_sources.append(v8_src + 'arm/constants-arm.cc')
    new_sources.append(v8_src + 'arm/simulator-arm.cc')
  vars.get_sources()[:] = new_sources
开发者ID:epowers,项目名称:arc,代码行数:27,代码来源:config.py


示例7: main

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
开发者ID:nehz,项目名称:google-arc,代码行数:26,代码来源:find_flaky_tests.py


示例8: _process_args

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
开发者ID:epowers,项目名称:arc,代码行数:33,代码来源:run_integration_tests.py


示例9: _get_generate_libvpx_asm_ninja

def _get_generate_libvpx_asm_ninja():
    if not OPTIONS.is_arm():
        return None

    gen_asm_ninja = ninja_generator.NinjaGenerator('libvpx_asm')
    # Translate RVCT format assembly code into GNU Assembler format.
    gen_asm_ninja.rule(
        _GEN_LIBVPX_ASM_RULE,
        command=_ADS2GAS + ' < $in > $out.tmp && (mv $out.tmp $out)')

    # Translate C source code into assembly code and run grep to
    # generate a list of constants. Assembly code generated by this rule
    # will be included from other assembly code. See
    # third_party/android/external/libvpx/libvpx.mk for corresponding
    # rules written in Makefile.
    asm_include_paths = [
        '-I' + staging.as_staging('android/external/libvpx/armv7a-neon'),
        '-I' + staging.as_staging('android/external/libvpx/libvpx')
    ]
    gen_asm_ninja.rule(
        _GEN_LIBVPX_OFFSETS_ASM_RULE,
        command=('%s -DINLINE_ASM %s -S $in -o $out.s && '
                 'grep \'^[a-zA-Z0-9_]* EQU\' $out.s | '
                 'tr -d \'$$\\#\' | '
                 '%s > $out.tmp && (mv $out.tmp $out)' % (toolchain.get_tool(
                     OPTIONS.target(), 'cc'), ' '.join(asm_include_paths),
                                                          _ADS2GAS)))

    return gen_asm_ninja
开发者ID:nehz,项目名称:google-arc,代码行数:29,代码来源:config.py


示例10: _convert_launch_chrome_options_to_external_metadata

def _convert_launch_chrome_options_to_external_metadata(parsed_args):
  metadata = parsed_args.additional_metadata

  for definition in manager.get_metadata_definitions():
    value = getattr(parsed_args, definition.python_name, None)
    if value is not None:
      metadata[definition.name] = value

  if bool(parsed_args.jdb_port or parsed_args.gdb):
    metadata['disableChildPluginRetry'] = True
    metadata['disableHeartbeat'] = True
    metadata['sleepOnBlur'] = False

  if (parsed_args.mode == 'atftest' or parsed_args.mode == 'system' or
      OPTIONS.get_system_packages()):
    # An app may briefly go through empty stack while running
    # addAccounts() in account manager service.
    # TODO(igorc): Find a more precise detection mechanism to support GSF,
    # implement empty stack timeout, or add a flag if this case is more common.
    metadata['allowEmptyActivityStack'] = True

  command = _generate_shell_command(parsed_args)
  if command:
    metadata['shell'] = command

  metadata['isDebugCodeEnabled'] = OPTIONS.is_debug_code_enabled()

  return metadata
开发者ID:epowers,项目名称:arc,代码行数:28,代码来源:prep_launch_chrome.py


示例11: generate_ninjas

def generate_ninjas():
    base_path = os.path.join("graphics_translation", "egl")

    n = ninja_generator.ArchiveNinjaGenerator("libegl", force_compiler="clang", enable_cxx11=True, base_path=base_path)
    n.add_compiler_flags("-Werror")
    n.add_notice_sources(["mods/graphics_translation/NOTICE"])
    n.add_include_paths(
        "mods",
        "android/system/core/include",
        "android/hardware/libhardware/include",
        "android/frameworks/native/include",
        "android/frameworks/native/opengl/include",
    )

    n.emit_gl_common_flags(False)
    n.add_ppapi_compile_flags()
    if OPTIONS.is_egl_api_tracing():
        n.add_defines("ENABLE_API_TRACING")
    if OPTIONS.is_egl_api_logging():
        n.add_defines("ENABLE_API_LOGGING")
    if OPTIONS.is_ansi_fb_logging():
        n.add_defines("ANSI_FB_LOGGING")

    sources = n.find_all_sources()
    n.build_default(sources, base_path="mods")
    n.archive()
开发者ID:nehz,项目名称:google-arc,代码行数:26,代码来源:config.py


示例12: _generate_jemalloc_integration_tests

def _generate_jemalloc_integration_tests():
  paths = build_common.find_all_files(
      'android/external/jemalloc/test/integration', ['.c'], include_tests=True)

  # Disable some multi-threaded tests flaky under ARM qemu.
  if OPTIONS.is_arm():
    paths.remove('android/external/jemalloc/test/integration/MALLOCX_ARENA.c')
    paths.remove('android/external/jemalloc/test/integration/thread_arena.c')

  for path in paths:
    name = os.path.splitext(os.path.basename(path))[0]
    n = ninja_generator.TestNinjaGenerator('jemalloc_integartion_test_' + name)
    n.add_include_paths(
        'android/external/jemalloc/include',
        'android/external/jemalloc/test/include')
    n.add_c_flags('-Werror')
    n.add_c_flags('-DJEMALLOC_INTEGRATION_TEST')
    if OPTIONS.enable_jemalloc_debug():
      n.add_c_flags('-DJEMALLOC_DEBUG')
    # Needs C99 for "restrict" keyword.
    n.add_c_flags('-std=gnu99')
    n.add_library_deps('libjemalloc.a')
    n.add_library_deps('libjemalloc_integrationtest.a')
    n.build_default([path])
    n.run(n.link(), enable_valgrind=OPTIONS.enable_valgrind(), rule='run_test')
开发者ID:epowers,项目名称:arc,代码行数:25,代码来源:config.py


示例13: _generate_jemalloc_unit_tests

def _generate_jemalloc_unit_tests():
  paths = build_common.find_all_files(
      'android/external/jemalloc/test/unit', ['.c'], include_tests=True)

  # These tests need -DJEMALLOC_PROF which we do not enable.
  paths.remove('android/external/jemalloc/test/unit/prof_accum.c')
  paths.remove('android/external/jemalloc/test/unit/prof_accum_a.c')
  paths.remove('android/external/jemalloc/test/unit/prof_accum_b.c')
  paths.remove('android/external/jemalloc/test/unit/prof_gdump.c')
  paths.remove('android/external/jemalloc/test/unit/prof_idump.c')

  # Disable some multi-threaded tests flaky under ARM qemu.
  if OPTIONS.is_arm():
    paths.remove('android/external/jemalloc/test/unit/mq.c')
    paths.remove('android/external/jemalloc/test/unit/mtx.c')

  for path in paths:
    name = os.path.splitext(os.path.basename(path))[0]
    n = ninja_generator.TestNinjaGenerator('jemalloc_unit_test_' + name)
    n.add_include_paths(
        'android/external/jemalloc/include',
        'android/external/jemalloc/test/include')
    n.add_c_flags('-Werror')
    n.add_c_flags('-DJEMALLOC_UNIT_TEST')
    if OPTIONS.enable_jemalloc_debug():
      n.add_c_flags('-DJEMALLOC_DEBUG')
    # Needs C99 for "restrict" keyword.
    n.add_c_flags('-std=gnu99')
    n.add_library_deps('libjemalloc_jet.a')
    n.add_library_deps('libjemalloc_unittest.a')
    n.build_default([path])
    n.run(n.link(), enable_valgrind=OPTIONS.enable_valgrind(), rule='run_test')
开发者ID:epowers,项目名称:arc,代码行数:32,代码来源:config.py


示例14: run

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
开发者ID:epowers,项目名称:arc,代码行数:32,代码来源:sync_arc_int.py


示例15: _generate_test_framework_ninjas

def _generate_test_framework_ninjas():
  # Build two versions of libgtest and libgmock that are built and linked with
  # STLport or libc++. It is used to build tests that depends on each library.
  _generate_gtest_ninja('libgtest', enable_libcxx=False)

  if not OPTIONS.run_tests():
    gtest_libcxx_instances = 0
  else:
    # libart-gtest.so, libarttest.so, and libnativebridgetest.so uses
    # libgtest_libc++.a. But when --disable-debug-code is specified,
    # libart-gtest.so is not built.
    if OPTIONS.is_debug_code_enabled():
      gtest_libcxx_instances = 3
    else:
      gtest_libcxx_instances = 2
  _generate_gtest_ninja('libgtest_libc++',
                        instances=gtest_libcxx_instances, enable_libcxx=True)

  # libartd.so for host uses libgtest_host.a. Although it is built with
  # libc++, it is not named libgtest_libc++_host.a by Android.mk.
  if OPTIONS.is_debug_code_enabled():
    _generate_gtest_ninja('libgtest_host', host=True, enable_libcxx=True)

  _generate_gmock_ninja('libgmock', enable_libcxx=False)
  _generate_gmock_ninja('libgmock_libc++', enable_libcxx=True)
开发者ID:epowers,项目名称:arc,代码行数:25,代码来源:config.py


示例16: _set_up_internal_repo

def _set_up_internal_repo():
  if OPTIONS.internal_apks_source_is_internal():
    # Checkout internal/ repository if needed, and sync internal/third_party/*
    # to internal/build/DEPS.*.  The files needs to be re-staged and is done
    # in staging.create_staging.
    subprocess.check_call('src/build/sync_arc_int.py')

  # Create a symlink to the integration_test definition directory, either in the
  # internal repository checkout or in the downloaded archive.
  # It is used to determine the definitions loaded in run_integration_tests.py
  # without relying on OPTIONS. Otherwise, run_integration_tests_test may fail
  # due to the mismatch between the expectations and the actual test apk since
  # it always runs under the default OPTIONS.
  if OPTIONS.internal_apks_source_is_internal():
    test_dir = 'internal/integration_tests'
  else:
    test_dir = 'out/internal-apks/integration_tests'

  symlink_location = 'out/internal-apks-integration-tests'
  if not os.path.islink(symlink_location) and os.path.isdir(symlink_location):
    # TODO(crbug.com/517306): This is a short-term fix for making bots green.
    # Remove once we implement a more proper solution (like, isolating the
    # test bundle extraction directory from the checkout, or stop running
    # ./configure on test-only builders.)
    #
    # 'Test only' bots extracts a directory structure from test-bundle zip, so
    # in that case we don't need to create a symlink.
    print 'WARNING: A directory exists at %s.' % symlink_location
    print 'WARNING: If not on test-only bot, gms test expectation may be stale.'
  else:
    # Otherwise, (re)create the link.
    file_util.create_link(symlink_location, test_dir, overwrite=True)
开发者ID:epowers,项目名称:arc,代码行数:32,代码来源:configure.py


示例17: main

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)
开发者ID:epowers,项目名称:arc,代码行数:8,代码来源:breakpad.py


示例18: get_art_isa

def get_art_isa():
    if OPTIONS.is_i686():
        return "x86"
    elif OPTIONS.is_x86_64():
        return "x86_64"
    elif OPTIONS.is_arm():
        return "arm"
    raise Exception("Unable to map target into an ART ISA: %s" % OPTIONS.target())
开发者ID:nehz,项目名称:google-arc,代码行数:8,代码来源:build_common.py


示例19: _get_ninja_jobs_argument

def _get_ninja_jobs_argument():
    # -j200 might be good because having more tasks doesn't help a
    # lot and Z620 doesn't die even if everything runs locally for
    # some reason.
    if OPTIONS.set_up_goma():
        OPTIONS.wait_for_goma_ctl()
        return ["-j200", "-l40"]
    return []
开发者ID:nehz,项目名称:google-arc,代码行数:8,代码来源:build_common.py


示例20: get_chrome_prebuilt_arch_bits

def get_chrome_prebuilt_arch_bits():
    # Use 32-bit version of Chrome on Windows regardless of the target bit size.
    if platform_util.is_running_on_cygwin():
        return "32"
    elif OPTIONS.is_x86_64() or OPTIONS.is_bare_metal_i686():
        return "64"
    else:
        return "32"
开发者ID:nehz,项目名称:google-arc,代码行数:8,代码来源:build_common.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python run.run函数代码示例发布时间:2022-05-27
下一篇:
Python Bbox.Bbox类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap