/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2006-12-21 19:28:45 UTC
  • mfrom: (2211 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2212.
  • Revision ID: john@arbash-meinel.com-20061221192845-fmv60t3k5t0xxks4
[merge] bzr.dev 2211

Show diffs side-by-side

added added

removed removed

Lines of Context:
192
192
                self._formatTime(self._benchmarkTime),
193
193
                self._elapsedTestTimeString())
194
194
        else:
195
 
            return "      %s" % self._elapsedTestTimeString()
 
195
            return "           %s" % self._elapsedTestTimeString()
196
196
 
197
197
    def _formatTime(self, seconds):
198
198
        """Format seconds as milliseconds with leading spaces."""
199
 
        return "%5dms" % (1000 * seconds)
 
199
        # some benchmarks can take thousands of seconds to run, so we need 8
 
200
        # places
 
201
        return "%8dms" % (1000 * seconds)
200
202
 
201
203
    def _shortened_test_description(self, test):
202
204
        what = test.id()
203
 
        what = re.sub(r'^bzrlib\.(tests|benchmark)\.', '', what)
 
205
        what = re.sub(r'^bzrlib\.(tests|benchmarks)\.', '', what)
204
206
        return what
205
207
 
206
208
    def startTest(self, test):
376
378
    def report_test_start(self, test):
377
379
        self.count += 1
378
380
        name = self._shortened_test_description(test)
 
381
        # width needs space for 6 char status, plus 1 for slash, plus 2 10-char
 
382
        # numbers, plus a trailing blank
379
383
        self.stream.write(self._ellipsize_to_right(name,
380
 
                            osutils.terminal_width()-20))
 
384
                            osutils.terminal_width()-30))
381
385
        self.stream.flush()
382
386
 
383
387
    def report_error(self, test, err):
1494
1498
                os.chdir(self.test_dir)
1495
1499
                break
1496
1500
 
1497
 
    def build_tree(self, shape, line_endings='native', transport=None):
 
1501
    def build_tree(self, shape, line_endings='binary', transport=None):
1498
1502
        """Build a test tree according to a pattern.
1499
1503
 
1500
1504
        shape is a sequence of file specifications.  If the final