예제 #1
0
  def map(self, test_case):
    """Traces a single test case and returns its output."""
    cmd = [self.executable, '--gtest_filter=%s' % test_case]
    cmd = list_test_cases.fix_python_path(cmd)
    tracename = test_case.replace('/', '-')

    out = []
    for retry in range(5):
      start = time.time()
      returncode, output = self.tracer.trace(
          cmd, self.cwd_dir, tracename, True)
      duration = time.time() - start
      # TODO(maruel): Define a way to detect if an strace log is valid.
      valid = True
      out.append(
          {
            'test_case': test_case,
            'returncode': returncode,
            'duration': duration,
            'valid': valid,
            'output': output,
          })
      logging.debug(
          'Tracing %s done: %d, %.1fs' % (test_case, returncode,  duration))
      if not valid:
        self.progress.increase_count()
      if retry:
        self.progress.update_item('%s - %d' % (test_case, retry))
      else:
        self.progress.update_item(test_case)
      if valid:
        break
    return out
예제 #2
0
 def map(self, test_case):
     """Traces a single test case and returns its output."""
     cmd = [self.executable, '--gtest_filter=%s' % test_case]
     cmd = list_test_cases.fix_python_path(cmd)
     out = []
     for retry in range(self.retry_count):
         start = time.time()
         output, returncode = call_with_timeout(cmd, self.cwd_dir,
                                                self.timeout)
         duration = time.time() - start
         out.append({
             'test_case': test_case,
             'returncode': returncode,
             'duration': duration,
             'output': output,
         })
         if returncode and retry != self.retry_count - 1:
             self.progress.increase_count()
         if retry:
             self.progress.update_item('%s - %d' % (test_case, retry))
         else:
             self.progress.update_item(test_case)
         if not returncode:
             break
     return out
예제 #3
0
    def map(self, test_case):
        """Traces a single test case and returns its output."""
        cmd = [self.executable, '--gtest_filter=%s' % test_case]
        cmd = list_test_cases.fix_python_path(cmd)
        tracename = test_case.replace('/', '-')

        out = []
        for retry in range(5):
            start = time.time()
            returncode, output = self.tracer.trace(cmd, self.cwd_dir,
                                                   tracename, True)
            duration = time.time() - start
            # TODO(maruel): Define a way to detect if an strace log is valid.
            valid = True
            out.append({
                'test_case': test_case,
                'returncode': returncode,
                'duration': duration,
                'valid': valid,
                'output': output,
            })
            if not valid:
                self.progress.increase_count()
            if retry:
                self.progress.update_item('%s - %d' % (test_case, retry))
            else:
                self.progress.update_item(test_case)
            if valid:
                break
        return out
예제 #4
0
 def map(self, test_case):
   """Traces a single test case and returns its output."""
   cmd = [self.executable, '--gtest_filter=%s' % test_case]
   cmd = list_test_cases.fix_python_path(cmd)
   out = []
   for retry in range(self.retry_count):
     start = time.time()
     output, returncode = call_with_timeout(cmd, self.cwd_dir, self.timeout)
     duration = time.time() - start
     out.append(
         {
           'test_case': test_case,
           'returncode': returncode,
           'duration': duration,
           'output': output,
         })
     if returncode and retry != self.retry_count - 1:
       self.progress.increase_count()
     if retry:
       self.progress.update_item('%s - %d' % (test_case, retry))
     else:
       self.progress.update_item(test_case)
     if not returncode:
       break
   return out