~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Robert Collins
  • Date: 2005-10-05 05:29:27 UTC
  • mfrom: (1393.1.51)
  • Revision ID: robertc@robertcollins.net-20051005052926-03d3a49e1dbcb670
mergeĀ fromĀ martin

Show diffs side-by-side

added added

removed removed

Lines of Context:
1101
1101
 
1102
1102
 
1103
1103
class cmd_selftest(Command):
1104
 
    """Run internal test suite"""
 
1104
    """Run internal test suite.
 
1105
    
 
1106
    This creates temporary test directories in the working directory,
 
1107
    but not existing data is affected.  These directories are deleted
 
1108
    if the tests pass, or left behind to help in debugging if they
 
1109
    fail.
 
1110
    
 
1111
    If arguments are given, they are regular expressions that say
 
1112
    which tests should run."""
 
1113
    # TODO: --list should give a list of all available tests
1105
1114
    hidden = True
 
1115
    takes_args = ['testnames*']
1106
1116
    takes_options = ['verbose', 'pattern']
1107
 
    def run(self, verbose=False, pattern=".*"):
 
1117
    def run(self, testnames_list=None, verbose=False, pattern=".*"):
1108
1118
        import bzrlib.ui
1109
1119
        from bzrlib.selftest import selftest
1110
1120
        # we don't want progress meters from the tests to go to the
1114
1124
        bzrlib.trace.info('running tests...')
1115
1125
        try:
1116
1126
            bzrlib.ui.ui_factory = bzrlib.ui.SilentUIFactory()
1117
 
            result = selftest(verbose=verbose, pattern=pattern)
 
1127
            result = selftest(verbose=verbose, 
 
1128
                              pattern=pattern,
 
1129
                              testnames=testnames_list)
1118
1130
            if result:
1119
1131
                bzrlib.trace.info('tests passed')
1120
1132
            else: