コード例 #1
0
def GetDeploymentTargetForArgs(args):
    """Constructs a deployment target object using parameters taken from
  command line arguments."""

    if args.system_log_file == '-':
        system_log_file = sys.stdout
    elif args.system_log_file:
        system_log_file = open(args.system_log_file, 'w')
    else:
        system_log_file = None

    if not args.device:
        # KVM is required on x64 test bots.
        require_kvm = hasattr(args, "test_launcher_bot_mode") and \
            args.test_launcher_bot_mode and args.target_cpu == "x64"

        return QemuTarget(output_dir=args.output_directory,
                          target_cpu=args.target_cpu,
                          cpu_cores=args.qemu_cpu_cores,
                          system_log_file=system_log_file,
                          require_kvm=require_kvm)
    else:
        return DeviceTarget(output_dir=args.output_directory,
                            target_cpu=args.target_cpu,
                            host=args.host,
                            node_name=args.node_name,
                            port=args.port,
                            ssh_config=args.ssh_config,
                            fuchsia_out_dir=args.fuchsia_out_dir,
                            system_log_file=system_log_file,
                            os_check=args.os_check)
コード例 #2
0
ファイル: common_args.py プロジェクト: quinndiggity/chromium
def GetDeploymentTargetForArgs(args):
    """Constructs a deployment target object using parameters taken from
  command line arguments."""

    if not args.device:
        return QemuTarget(args.output_directory, args.target_cpu)
    else:
        return DeviceTarget(args.output_directory, args.target_cpu, args.host,
                            args.port, args.ssh_config)
コード例 #3
0
ファイル: common_args.py プロジェクト: sreerenjb/chromium-1
def GetDeploymentTargetForArgs(args, require_kvm=False):
    """Constructs a deployment target object using parameters taken from
  command line arguments."""
    if args.system_log_file == '-':
        system_log_file = sys.stdout
    elif args.system_log_file:
        system_log_file = open(args.system_log_file, 'w')
    else:
        system_log_file = None

    # Allow fuchsia to run on emulator if device not explicitly chosen.
    # AEMU is the default emulator for x64 Fuchsia, and QEMU for others.
    if not args.device:
        if args.target_cpu == 'x64':
            args.device = 'aemu'
        else:
            args.device = 'qemu'

    target_args = {
        'output_dir': args.output_directory,
        'target_cpu': args.target_cpu,
        'system_log_file': system_log_file
    }
    if args.device == 'device':
        target_args.update({
            'host': args.host,
            'node_name': args.node_name,
            'port': args.port,
            'ssh_config': args.ssh_config,
            'fuchsia_out_dir': args.fuchsia_out_dir,
            'os_check': args.os_check
        })
        return DeviceTarget(**target_args)
    else:
        target_args.update({
            'cpu_cores': args.qemu_cpu_cores,
            'require_kvm': not args.no_kvm,
            'emu_type': args.device,
            'ram_size_mb': args.memory
        })
        if args.device == 'qemu':
            return QemuTarget(**target_args)
        else:
            target_args.update({
                'enable_graphics': args.enable_graphics,
                'hardware_gpu': args.hardware_gpu
            })
            return AemuTarget(**target_args)
コード例 #4
0
def GetDeploymentTargetForArgs(args):
  """Constructs a deployment target object using parameters taken from
  command line arguments."""

  if args.system_log_file == '-':
    system_log_file = sys.stdout
  elif args.system_log_file:
    system_log_file = open(args.system_log_file, 'w')
  else:
    system_log_file = None

  if not args.device:
    return QemuTarget(args.output_directory, args.target_cpu,
                      args.qemu_cpu_cores, system_log_file)
  else:
    return DeviceTarget(args.output_directory, args.target_cpu, args.host,
                        args.port, args.ssh_config, system_log_file)