Exemple #1
0
 def testStatusFilePresubmit(self):
     """Test that the fake status file is well-formed."""
     with temp_base() as basedir:
         from testrunner.local import statusfile
         self.assertTrue(
             statusfile.PresubmitCheck(
                 os.path.join(basedir, 'test', 'sweet', 'sweet.status')))
Exemple #2
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
Exemple #3
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
Exemple #4
0
  def ProcessFiles(self, files):
    test_path = join(dirname(TOOLS_PATH), 'test')
    status_files = set([])
    for file_path in files:
      if file_path.startswith(test_path):
        # Strip off absolute path prefix pointing to test suites.
        pieces = file_path[len(test_path):].lstrip(os.sep).split(os.sep)
        if pieces:
          # Infer affected status file name. Only care for existing status
          # files. Some directories under "test" don't have any.
          if not os.path.isdir(join(test_path, pieces[0])):
            continue
          status_file = join(test_path, pieces[0], pieces[0] + ".status")
          if not os.path.exists(status_file):
            continue
          status_files.add(status_file)

    success = True
    for status_file_path in sorted(status_files):
      success &= statusfile.PresubmitCheck(status_file_path)
      success &= _CheckStatusFileForDuplicateKeys(status_file_path)
    return success
Exemple #5
0
 def ProcessFiles(self, files):
     success = True
     for status_file_path in sorted(self._GetStatusFiles(files)):
         success &= statusfile.PresubmitCheck(status_file_path)
         success &= _CheckStatusFileForDuplicateKeys(status_file_path)
     return success