Exemplo n.º 1
0
def CreateTestInstance(args, error_func):

    if args.command == 'gtest':
        return gtest_test_instance.GtestTestInstance(
            args, isolator.Isolator(constants.ISOLATE_DEPS_DIR), error_func)
    elif args.command == 'instrumentation':
        return instrumentation_test_instance.InstrumentationTestInstance(
            args, isolator.Isolator(constants.ISOLATE_DEPS_DIR), error_func)
    elif args.command == 'uirobot':
        return uirobot_test_instance.UirobotTestInstance(args, error_func)

    error_func('Unable to create %s test instance.' % args.command)
Exemplo n.º 2
0
def CreateTestInstance(args, error_func):

    if args.command == 'gtest':
        return gtest_test_instance.GtestTestInstance(args, isolator.Isolator(),
                                                     error_func)
    elif args.command == 'instrumentation':
        return instrumentation_test_instance.InstrumentationTestInstance(
            args, isolator.Isolator(), error_func)
    elif args.command == 'junit':
        return junit_test_instance.JunitTestInstance(args, error_func)
    elif args.command == 'monkey':
        return monkey_test_instance.MonkeyTestInstance(args, error_func)
    elif args.command == 'perf':
        return perf_test_instance.PerfTestInstance(args, error_func)

    error_func('Unable to create %s test instance.' % args.command)
Exemplo n.º 3
0
def CreateTestInstance(args, error_func):

    if args.command == 'gtest':
        return gtest_test_instance.GtestTestInstance(
            args, isolator.Isolator(constants.ISOLATE_DEPS_DIR))
    # TODO(jbudorick) Add instrumentation test instance.

    error_func('Unable to create %s test instance.' % args.command)
Exemplo n.º 4
0
def GenerateDepsDirUsingIsolate(suite_name, isolate_file_path,
                                isolate_file_paths, deps_exclusion_list):
    """Generate the dependency dir for the test suite using isolate.

  Args:
    suite_name: Name of the test suite (e.g. base_unittests).
    isolate_file_path: .isolate file path to use. If there is a default .isolate
                       file path for the suite_name, this will override it.
    isolate_file_paths: Dictionary with the default .isolate file paths for
                        the test suites.
    deps_exclusion_list: A list of files that are listed as dependencies in the
                         .isolate files but should not be pushed to the device.
  Returns:
    The Isolator instance used to remap the dependencies, or None.
  """
    if isolate_file_path:
        if os.path.isabs(isolate_file_path):
            isolate_abs_path = isolate_file_path
        else:
            isolate_abs_path = os.path.join(constants.DIR_SOURCE_ROOT,
                                            isolate_file_path)
    else:
        isolate_rel_path = isolate_file_paths.get(suite_name)
        if not isolate_rel_path:
            logging.info('Did not find an isolate file for the test suite.')
            return
        isolate_abs_path = os.path.join(constants.DIR_SOURCE_ROOT,
                                        isolate_rel_path)

    isolated_abs_path = os.path.join(constants.GetOutDirectory(),
                                     '%s.isolated' % suite_name)
    assert os.path.exists(
        isolate_abs_path), 'Cannot find %s' % isolate_abs_path

    i = isolator.Isolator()
    i.Clear()
    i.Remap(isolate_abs_path, isolated_abs_path)
    # We're relying on the fact that timestamps are preserved
    # by the remap command (hardlinked). Otherwise, all the data
    # will be pushed to the device once we move to using time diff
    # instead of md5sum. Perform a sanity check here.
    i.VerifyHardlinks()
    i.PurgeExcluded(deps_exclusion_list)
    i.MoveOutputDeps()
    return i