~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
195
195
    def _testTimeString(self, testCase):
196
196
        benchmark_time = self._extractBenchmarkTime(testCase)
197
197
        if benchmark_time is not None:
198
 
            return "%s/%s" % (
199
 
                self._formatTime(benchmark_time),
200
 
                self._elapsedTestTimeString())
 
198
            return self._formatTime(benchmark_time) + "*"
201
199
        else:
202
 
            return "           %s" % self._elapsedTestTimeString()
 
200
            return self._elapsedTestTimeString()
203
201
 
204
202
    def _formatTime(self, seconds):
205
203
        """Format seconds as milliseconds with leading spaces."""
346
344
            self.stream.write("%s: " % flavour)
347
345
            self.stream.writeln(self.getDescription(test))
348
346
            if getattr(test, '_get_log', None) is not None:
349
 
                self.stream.write('\n')
350
 
                self.stream.write(
351
 
                        ('vvvv[log from %s]' % test.id()).ljust(78,'-'))
352
 
                self.stream.write('\n')
353
 
                self.stream.write(test._get_log())
354
 
                self.stream.write('\n')
355
 
                self.stream.write(
356
 
                        ('^^^^[log from %s]' % test.id()).ljust(78,'-'))
357
 
                self.stream.write('\n')
 
347
                log_contents = test._get_log()
 
348
                if log_contents:
 
349
                    self.stream.write('\n')
 
350
                    self.stream.write(
 
351
                            ('vvvv[log from %s]' % test.id()).ljust(78,'-'))
 
352
                    self.stream.write('\n')
 
353
                    self.stream.write(log_contents)
 
354
                    self.stream.write('\n')
 
355
                    self.stream.write(
 
356
                            ('^^^^[log from %s]' % test.id()).ljust(78,'-'))
 
357
                    self.stream.write('\n')
358
358
            self.stream.writeln(self.separator2)
359
359
            self.stream.writeln("%s" % err)
360
360
 
486
486
    def report_test_start(self, test):
487
487
        self.count += 1
488
488
        name = self._shortened_test_description(test)
489
 
        # width needs space for 6 char status, plus 1 for slash, plus 2 10-char
490
 
        # numbers, plus a trailing blank
 
489
        # width needs space for 6 char status, plus 1 for slash, plus an
 
490
        # 11-char time string, plus a trailing blank
491
491
        # when NUMBERED_DIRS: plus 5 chars on test number, plus 1 char on space
492
492
        self.stream.write(self._ellipsize_to_right(name,
493
 
                          osutils.terminal_width()-30))
 
493
                          osutils.terminal_width()-18))
494
494
        self.stream.flush()
495
495
 
496
496
    def _error_summary(self, err):