/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: mbp at sourcefrog
  • Date: 2006-10-31 01:30:31 UTC
  • mto: This revision was merged to the branch mainline in revision 2114.
  • Revision ID: mbp@sourcefrog.net-20061031013031-da3047f0d9fb1f64
Use regular progress-bar classes, not a special mechanism

Show diffs side-by-side

added added

removed removed

Lines of Context:
286
286
class TextTestResult(ExtendedTestResult):
287
287
    """Displays progress and results of tests in text form"""
288
288
 
 
289
    def __init__(self, *args, **kw):
 
290
        ExtendedTestResult.__init__(self, *args, **kw)
 
291
        self.pb = self.ui.nested_progress_bar()
 
292
        self.pb.show_pct = False
 
293
        self.pb.show_spinner = False
 
294
        self.pb.show_eta = False, 
 
295
        self.pb.show_count = False
 
296
        self.pb.show_bar = False
 
297
 
289
298
    def report_starting(self):
290
 
        self.ui.show_progress_line('[test 0/%d] starting tests...' 
291
 
                % (self.num_tests))
 
299
        self.pb.update('[test 0/%d] starting...' % (self.num_tests))
292
300
 
293
301
    def _progress_prefix_text(self):
294
302
        a = '[%d' % self.count
306
314
 
307
315
    def report_test_start(self, test):
308
316
        self.count += 1
309
 
        self.ui.show_progress_line(
 
317
        self.pb.update(
310
318
                self._progress_prefix_text()
311
319
                + ' ' 
312
320
                + self._shortened_test_description(test))
313
321
 
314
322
    def report_error(self, test, err):
315
323
        self.error_count += 1
316
 
        self.ui.message('ERROR: %s\n    %s\n' % (
 
324
        self.pb.note('ERROR: %s\n    %s\n' % (
317
325
            self._shortened_test_description(test),
318
326
            err[1],
319
327
            ))
320
328
 
321
329
    def report_failure(self, test, err):
322
330
        self.failure_count += 1
323
 
        self.ui.message('FAIL: %s\n    %s\n' % (
 
331
        self.pb.note('FAIL: %s\n    %s\n' % (
324
332
            self._shortened_test_description(test),
325
333
            err[1],
326
334
            ))
333
341
            # to see them.
334
342
            if False:
335
343
                # show test and reason for skip
336
 
                self.ui.message('SKIP: %s\n    %s\n' % (
 
344
                self.pb.note('SKIP: %s\n    %s\n' % (
337
345
                    self._shortened_test_description(test),
338
346
                    skip_excinfo[1]))
339
347
            else:
340
348
                # since the class name was left behind in the still-visible
341
349
                # progress bar...
342
 
                self.ui.message('SKIP: %s' % (
343
 
                    skip_excinfo[1]))
 
350
                self.pb.note('SKIP: %s' % (skip_excinfo[1]))
344
351
 
345
352
    def report_cleaning_up(self):
346
 
        self.ui.show_progress_line('cleaning up...')
 
353
        self.pb.update('cleaning up...')
347
354
 
348
355
    def finished(self):
349
 
        self.ui.clear_term()
 
356
        self.pb.finished()
350
357
 
351
358
 
352
359
class VerboseTestResult(ExtendedTestResult):