~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/__init__.py

[merge] aaron, various fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
519
519
 
520
520
 
521
521
def run_suite(suite, name='test', verbose=False, pattern=".*",
522
 
              stop_on_failure=False):
 
522
              stop_on_failure=False, keep_output=False):
523
523
    TestCaseInTempDir._TEST_NAME = name
524
524
    if verbose:
525
525
        verbosity = 2
535
535
    # This is still a little bogus, 
536
536
    # but only a little. Folk not using our testrunner will
537
537
    # have to delete their temp directories themselves.
538
 
    if result.wasSuccessful():
 
538
    if result.wasSuccessful() or not keep_output:
539
539
        if TestCaseInTempDir.TEST_ROOT is not None:
540
540
            shutil.rmtree(TestCaseInTempDir.TEST_ROOT) 
541
541
    else:
543
543
    return result.wasSuccessful()
544
544
 
545
545
 
546
 
def selftest(verbose=False, pattern=".*", stop_on_failure=True):
 
546
def selftest(verbose=False, pattern=".*", stop_on_failure=True,
 
547
             keep_output=False):
547
548
    """Run the whole test suite under the enhanced runner"""
548
549
    return run_suite(test_suite(), 'testbzr', verbose=verbose, pattern=pattern,
549
 
                     stop_on_failure=stop_on_failure)
 
550
                     stop_on_failure=stop_on_failure, keep_output=keep_output)
550
551
 
551
552
 
552
553
def test_suite():