~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

- run all selftests by default

Show diffs side-by-side

added added

removed removed

Lines of Context:
1141
1141
    fail.
1142
1142
    
1143
1143
    If arguments are given, they are regular expressions that say
1144
 
    which tests should run."""
 
1144
    which tests should run.
 
1145
    """
1145
1146
    # TODO: --list should give a list of all available tests
1146
1147
    hidden = True
1147
1148
    takes_args = ['testspecs*']
1148
 
    takes_options = ['verbose']
1149
 
    def run(self, testspecs_list=None, verbose=False):
 
1149
    takes_options = ['verbose', 
 
1150
                     Option('one', help='stop when one test fails'),
 
1151
                    ]
 
1152
 
 
1153
    def run(self, testspecs_list=None, verbose=False, one=False):
1150
1154
        import bzrlib.ui
1151
1155
        from bzrlib.selftest import selftest
1152
1156
        # we don't want progress meters from the tests to go to the
1161
1165
            else:
1162
1166
                pattern = ".*"
1163
1167
            result = selftest(verbose=verbose, 
1164
 
                              pattern=pattern)
 
1168
                              pattern=pattern,
 
1169
                              stop_on_failure=one)
1165
1170
            if result:
1166
1171
                bzrlib.trace.info('tests passed')
1167
1172
            else: