Beispiel #1
0
    def _do_execute(self, options, args):
        # Use the v8 root as cwd as some test cases use "load" with relative paths.
        os.chdir(base_runner.BASE_DIR)

        suite_paths = utils.GetSuitePaths(join(base_runner.BASE_DIR, "test"))

        if len(args) == 0:
            suite_paths = [s for s in suite_paths if s in DEFAULT_TESTS]
        else:
            args_suites = set()
            for arg in args:
                suite = arg.split(os.path.sep)[0]
                if not suite in args_suites:
                    args_suites.add(suite)
            suite_paths = [s for s in suite_paths if s in args_suites]

        suites = []
        for root in suite_paths:
            suite = testsuite.TestSuite.LoadTestSuite(
                os.path.join(base_runner.BASE_DIR, "test", root))
            if suite:
                suites.append(suite)

        try:
            return self._execute(args, options, suites)
        except KeyboardInterrupt:
            return 2
Beispiel #2
0
 def _args_to_suite_names(self, args):
     # Use default tests if no test configuration was provided at the cmd line.
     all_names = set(utils.GetSuitePaths(os.path.join(self.basedir,
                                                      'test')))
     args_names = OrderedDict([(arg.split('/')[0], None)
                               for arg in args])  # set
     return [name for name in args_names if name in all_names]
Beispiel #3
0
def Main():
    # Use the v8 root as cwd as some test cases use "load" with relative paths.
    os.chdir(BASE_DIR)

    parser = BuildOptions()
    (options, args) = parser.parse_args()
    if not ProcessOptions(options):
        parser.print_help()
        return 1

    exit_code = 0
    if not options.no_presubmit:
        print ">>> running presubmit tests"
        exit_code = subprocess.call(
            [sys.executable,
             join(BASE_DIR, "tools", "presubmit.py")])

    suite_paths = utils.GetSuitePaths(join(BASE_DIR, "test"))

    # Use default tests if no test configuration was provided at the cmd line.
    if len(args) == 0:
        args = ["default"]

    # Expand arguments with grouped tests. The args should reflect the list of
    # suites as otherwise filters would break.
    def ExpandTestGroups(name):
        if name in TEST_MAP:
            return [suite for suite in TEST_MAP[arg]]
        else:
            return [name]

    args = reduce(lambda x, y: x + y, [ExpandTestGroups(arg) for arg in args],
                  [])

    args_suites = OrderedDict()  # Used as set
    for arg in args:
        args_suites[arg.split('/')[0]] = True
    suite_paths = [s for s in args_suites if s in suite_paths]

    suites = []
    for root in suite_paths:
        suite = testsuite.TestSuite.LoadTestSuite(
            os.path.join(BASE_DIR, "test", root))
        if suite:
            suites.append(suite)

    if options.download_data or options.download_data_only:
        for s in suites:
            s.DownloadData()

    if options.download_data_only:
        return exit_code

    for (arch, mode) in options.arch_and_mode:
        try:
            code = Execute(arch, mode, args, options, suites)
        except KeyboardInterrupt:
            return 2
        exit_code = exit_code or code
    return exit_code
Beispiel #4
0
    def _do_execute(self, options, args):
        # Use the v8 root as cwd as some test cases use "load" with relative
        # paths.
        os.chdir(base_runner.BASE_DIR)

        self._setup_env(options)

        if options.swarming:
            # Swarming doesn't print how isolated commands are called. Lets make
            # this less cryptic by printing it ourselves.
            print ' '.join(sys.argv)

            if utils.GuessOS() == "macos":
                # TODO(machenbach): Temporary output for investigating hanging test
                # driver on mac.
                print "V8 related processes running on this host:"
                try:
                    print subprocess.check_output(
                        "ps -e | egrep 'd8|cctest|unittests'", shell=True)
                except Exception:
                    pass

        suite_paths = utils.GetSuitePaths(join(base_runner.BASE_DIR, "test"))

        # Use default tests if no test configuration was provided at the cmd line.
        if len(args) == 0:
            args = ["default"]

        # Expand arguments with grouped tests. The args should reflect the list
        # of suites as otherwise filters would break.
        def ExpandTestGroups(name):
            if name in base_runner.TEST_MAP:
                return [suite for suite in base_runner.TEST_MAP[name]]
            else:
                return [name]

        args = reduce(lambda x, y: x + y,
                      [ExpandTestGroups(arg) for arg in args], [])

        args_suites = OrderedDict()  # Used as set
        for arg in args:
            args_suites[arg.split('/')[0]] = True
        suite_paths = [s for s in args_suites if s in suite_paths]

        suites = []
        for root in suite_paths:
            suite = testsuite.TestSuite.LoadTestSuite(
                os.path.join(base_runner.BASE_DIR, "test", root))
            if suite:
                suites.append(suite)

        for s in suites:
            s.PrepareSources()

        try:
            return self._execute(args, options, suites)
        except KeyboardInterrupt:
            return 2
Beispiel #5
0
def Main():
    parser = BuildOptions()
    (options, args) = parser.parse_args()
    if not ProcessOptions(options):
        parser.print_help()
        return 1

    exit_code = 0
    workspace = os.path.abspath(join(os.path.dirname(sys.argv[0]), ".."))
    if not options.no_presubmit:
        print ">>> running presubmit tests"
        exit_code = subprocess.call(
            [sys.executable,
             join(workspace, "tools", "presubmit.py")])

    suite_paths = utils.GetSuitePaths(join(workspace, "test"))

    # Expand arguments with grouped tests. The args should reflect the list of
    # suites as otherwise filters would break.
    def ExpandTestGroups(name):
        if name in TEST_MAP:
            return [suite for suite in TEST_MAP[arg]]
        else:
            return [name]

    args = reduce(lambda x, y: x + y, [ExpandTestGroups(arg) for arg in args],
                  [])

    if len(args) == 0:
        suite_paths = [s for s in DEFAULT_TESTS if s in suite_paths]
    else:
        args_suites = OrderedDict()  # Used as set
        for arg in args:
            args_suites[arg.split(os.path.sep)[0]] = True
        suite_paths = [s for s in args_suites if s in suite_paths]

    suites = []
    for root in suite_paths:
        suite = testsuite.TestSuite.LoadTestSuite(
            os.path.join(workspace, "test", root))
        if suite:
            suites.append(suite)

    if options.download_data or options.download_data_only:
        for s in suites:
            s.DownloadData()

    if options.download_data_only:
        return exit_code

    for (arch, mode) in options.arch_and_mode:
        try:
            code = Execute(arch, mode, args, options, suites, workspace)
        except KeyboardInterrupt:
            return 2
        exit_code = exit_code or code
    return exit_code
Beispiel #6
0
def Main():
  # Use the v8 root as cwd as some test cases use "load" with relative paths.
  os.chdir(BASE_DIR)

  parser = BuildOptions()
  (options, args) = parser.parse_args()
  if not ProcessOptions(options):
    parser.print_help()
    return 1
  SetupEnvironment(options)

  if options.swarming:
    # Swarming doesn't print how isolated commands are called. Lets make this
    # less cryptic by printing it ourselves.
    print ' '.join(sys.argv)

  exit_code = 0

  suite_paths = utils.GetSuitePaths(join(BASE_DIR, "test"))

  # Use default tests if no test configuration was provided at the cmd line.
  if len(args) == 0:
    args = ["default"]

  # Expand arguments with grouped tests. The args should reflect the list of
  # suites as otherwise filters would break.
  def ExpandTestGroups(name):
    if name in TEST_MAP:
      return [suite for suite in TEST_MAP[name]]
    else:
      return [name]
  args = reduce(lambda x, y: x + y,
         [ExpandTestGroups(arg) for arg in args],
         [])

  args_suites = OrderedDict() # Used as set
  for arg in args:
    args_suites[arg.split('/')[0]] = True
  suite_paths = [ s for s in args_suites if s in suite_paths ]

  suites = []
  for root in suite_paths:
    suite = testsuite.TestSuite.LoadTestSuite(
        os.path.join(BASE_DIR, "test", root))
    if suite:
      suites.append(suite)

  for s in suites:
    s.PrepareSources()

  for (arch, mode) in options.arch_and_mode:
    try:
      code = Execute(arch, mode, args, options, suites)
    except KeyboardInterrupt:
      return 2
    exit_code = exit_code or code
  return exit_code
Beispiel #7
0
def CheckStatusFiles(workspace):
  suite_paths = utils.GetSuitePaths(join(workspace, "test"))
  for root in suite_paths:
    suite_path = join(workspace, "test", root)
    status_file_path = join(suite_path, root + ".status")
    suite = testsuite.TestSuite.LoadTestSuite(suite_path)
    if suite and exists(status_file_path):
      if not statusfile.PresubmitCheck(status_file_path):
        return False
  return True
Beispiel #8
0
def CheckStatusFiles(workspace):
    success = True
    suite_paths = utils.GetSuitePaths(join(workspace, "test"))
    for root in suite_paths:
        suite_path = join(workspace, "test", root)
        status_file_path = join(suite_path, root + ".status")
        suite = testsuite.TestSuite.LoadTestSuite(suite_path)
        if suite and exists(status_file_path):
            success &= statusfile.PresubmitCheck(status_file_path)
            success &= _CheckStatusFileForDuplicateKeys(status_file_path)
    return success
Beispiel #9
0
def Main():
    parser = BuildOptions()
    (options, args) = parser.parse_args()
    if not ProcessOptions(options):
        parser.print_help()
        return 1

    exit_code = 0
    workspace = os.path.abspath(join(os.path.dirname(sys.argv[0]), ".."))
    if not options.no_presubmit:
        print ">>> running presubmit tests"
        code = subprocess.call(
            [sys.executable,
             join(workspace, "tools", "presubmit.py")])
        exit_code = code

    suite_paths = utils.GetSuitePaths(join(workspace, "test"))

    if len(args) == 0:
        suite_paths = [s for s in DEFAULT_TESTS if s in suite_paths]
    else:
        args_suites = set()
        for arg in args:
            suite = arg.split(os.path.sep)[0]
            if not suite in args_suites:
                args_suites.add(suite)
        suite_paths = [s for s in args_suites if s in suite_paths]

    suites = []
    for root in suite_paths:
        suite = testsuite.TestSuite.LoadTestSuite(
            os.path.join(workspace, "test", root))
        if suite:
            suites.append(suite)

    if options.download_data:
        for s in suites:
            s.DownloadData()

    for (arch, mode) in options.arch_and_mode:
        try:
            code = Execute(arch, mode, args, options, suites, workspace)
        except KeyboardInterrupt:
            return 2
        exit_code = exit_code or code
    return exit_code
Beispiel #10
0
def Main():
  # Use the v8 root as cwd as some test cases use "load" with relative paths.
  os.chdir(BASE_DIR)

  parser = BuildOptions()
  (options, args) = parser.parse_args()
  if not ProcessOptions(options):
    parser.print_help()
    return 1

  exit_code = 0

  suite_paths = utils.GetSuitePaths(join(BASE_DIR, "test"))

  if len(args) == 0:
    suite_paths = [ s for s in suite_paths if s in DEFAULT_TESTS ]
  else:
    args_suites = set()
    for arg in args:
      suite = arg.split(os.path.sep)[0]
      if not suite in args_suites:
        args_suites.add(suite)
    suite_paths = [ s for s in suite_paths if s in args_suites ]

  suites = []
  for root in suite_paths:
    suite = testsuite.TestSuite.LoadTestSuite(
        os.path.join(BASE_DIR, "test", root))
    if suite:
      suite.SetupWorkingDirectory()
      suites.append(suite)

  if options.download_data:
    for s in suites:
      s.DownloadData()

  for mode in options.mode:
    for arch in options.arch:
      try:
        code = Execute(arch, mode, args, options, suites, BASE_DIR)
        exit_code = exit_code or code
      except KeyboardInterrupt:
        return 2
  return exit_code
Beispiel #11
0
def Main():
    parser = BuildOptions()
    (options, args) = parser.parse_args()
    if not ProcessOptions(options):
        parser.print_help()
        return 1

    exit_code = 0
    workspace = os.path.abspath(join(os.path.dirname(sys.argv[0]), ".."))

    suite_paths = utils.GetSuitePaths(join(workspace, "test"))

    if len(args) == 0:
        suite_paths = [s for s in suite_paths if s in DEFAULT_TESTS]
    else:
        args_suites = set()
        for arg in args:
            suite = arg.split(os.path.sep)[0]
            if not suite in args_suites:
                args_suites.add(suite)
        suite_paths = [s for s in suite_paths if s in args_suites]

    suites = []
    for root in suite_paths:
        suite = testsuite.TestSuite.LoadTestSuite(
            os.path.join(workspace, "test", root))
        if suite:
            suite.SetupWorkingDirectory()
            suites.append(suite)

    if options.download_data:
        for s in suites:
            s.DownloadData()

    for mode in options.mode:
        for arch in options.arch:
            try:
                code = Execute(arch, mode, args, options, suites, workspace)
                exit_code = exit_code or code
            except KeyboardInterrupt:
                return 2
    return exit_code
Beispiel #12
0
  def _do_execute(self, options, args):
    suite_paths = utils.GetSuitePaths(join(self.basedir, "test"))

    if len(args) == 0:
      suite_paths = [ s for s in suite_paths if s in DEFAULT_TESTS ]
    else:
      args_suites = set()
      for arg in args:
        suite = arg.split(os.path.sep)[0]
        if not suite in args_suites:
          args_suites.add(suite)
      suite_paths = [ s for s in suite_paths if s in args_suites ]

    suites = []
    for root in suite_paths:
      suite = testsuite.TestSuite.LoadTestSuite(
          os.path.join(self.basedir, "test", root))
      if suite:
        suites.append(suite)

    try:
      return self._execute(args, options, suites)
    except KeyboardInterrupt:
      return 2