~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Robert Collins
  • Date: 2005-10-11 07:52:29 UTC
  • mto: This revision was merged to the branch mainline in revision 1444.
  • Revision ID: robertc@lifelesslap.robertcollins.net-20051011075229-e1a1429e0b59f80f
nuke --pattern to selftest, replace with regexp.search calls.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1120
1120
    which tests should run."""
1121
1121
    # TODO: --list should give a list of all available tests
1122
1122
    hidden = True
1123
 
    takes_args = ['testnames*']
1124
 
    takes_options = ['verbose', 'pattern']
1125
 
    def run(self, testnames_list=None, verbose=False, pattern=".*"):
 
1123
    takes_args = ['testspecs*']
 
1124
    takes_options = ['verbose']
 
1125
    def run(self, testspecs_list=None, verbose=False):
1126
1126
        import bzrlib.ui
1127
1127
        from bzrlib.selftest import selftest
1128
1128
        # we don't want progress meters from the tests to go to the
1132
1132
        bzrlib.trace.info('running tests...')
1133
1133
        try:
1134
1134
            bzrlib.ui.ui_factory = bzrlib.ui.SilentUIFactory()
 
1135
            if testspecs_list is not None:
 
1136
                pattern = '|'.join(testspecs_list)
 
1137
            else:
 
1138
                pattern = ".*"
1135
1139
            result = selftest(verbose=verbose, 
1136
 
                              pattern=pattern,
1137
 
                              testnames=testnames_list)
 
1140
                              pattern=pattern)
1138
1141
            if result:
1139
1142
                bzrlib.trace.info('tests passed')
1140
1143
            else: