Example #1
0
def CreateEnvironment(args, error_func):

  if args.environment == 'local':
    if args.command not in constants.LOCAL_MACHINE_TESTS:
      return local_device_environment.LocalDeviceEnvironment(args, error_func)
    else:
      return local_machine_environment.LocalMachineEnvironment(args, error_func)

  error_func('Unable to create %s environment.' % args.environment)
Example #2
0
def CreateEnvironment(args, error_func):

  if args.environment == 'local':
    if args.command not in constants.LOCAL_MACHINE_TESTS:
      return local_device_environment.LocalDeviceEnvironment(args, error_func)
    # TODO(jbudorick) Add local machine environment.
  if args.environment == 'remote_device' and remote_device_environment:
    return remote_device_environment.RemoteDeviceEnvironment(args,
                                                             error_func)
  error_func('Unable to create %s environment.' % args.environment)
def CreateEnvironment(args, output_manager, error_func):

    if args.environment == 'local':
        if args.command not in constants.LOCAL_MACHINE_TESTS:
            if args.avd_name:
                return local_emulator_environment.LocalEmulatorEnvironment(
                    args, output_manager, error_func)
            return local_device_environment.LocalDeviceEnvironment(
                args, output_manager, error_func)
        else:
            return local_machine_environment.LocalMachineEnvironment(
                args, output_manager, error_func)

    error_func('Unable to create %s environment.' % args.environment)
Example #4
0
def CreateEnvironment(args, output_manager, error_func):

  if args.environment == 'local':
    if args.command not in constants.LOCAL_MACHINE_TESTS:
      if args.avd_config:
        if not local_emulator_environment:
          error_func('emulator environment requested but not available.')
          raise RuntimeError('error_func must call exit inside.')
        return local_emulator_environment.LocalEmulatorEnvironment(
            args, output_manager, error_func)
      return local_device_environment.LocalDeviceEnvironment(
          args, output_manager, error_func)
    return local_machine_environment.LocalMachineEnvironment(
        args, output_manager, error_func)

  error_func('Unable to create %s environment.' % args.environment)
  raise RuntimeError('error_func must call exit inside.')