~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Martin Pool
  • Date: 2007-08-09 05:56:20 UTC
  • mfrom: (2658.3.6 111914)
  • mto: This revision was merged to the branch mainline in revision 2689.
  • Revision ID: mbp@sourcefrog.net-20070809055620-2tvrnr8v15h02fqh
Add selftest --strict

Show diffs side-by-side

added added

removed removed

Lines of Context:
323
323
    def report_success(self, test):
324
324
        pass
325
325
 
 
326
    def wasStrictlySuccessful(self):
 
327
        if self.unsupported or self.known_failure_count:
 
328
            return False
 
329
 
 
330
        return self.wasSuccessful()
 
331
 
 
332
 
326
333
 
327
334
class TextTestResult(ExtendedTestResult):
328
335
    """Displays progress and results of tests in text form"""
2172
2179
              list_only=False,
2173
2180
              random_seed=None,
2174
2181
              exclude_pattern=None,
 
2182
              strict=False,
2175
2183
              ):
2176
2184
    TestCase._gather_lsprof_in_benchmarks = lsprof_timed
2177
2185
    if verbose:
2210
2218
            suite = filter_suite_by_re(suite, pattern, exclude_pattern,
2211
2219
                random_order)
2212
2220
    result = runner.run(suite)
 
2221
 
 
2222
    if strict:
 
2223
        return result.wasStrictlySuccessful()
 
2224
 
2213
2225
    return result.wasSuccessful()
2214
2226
 
2215
2227
 
2221
2233
             matching_tests_first=None,
2222
2234
             list_only=False,
2223
2235
             random_seed=None,
2224
 
             exclude_pattern=None):
 
2236
             exclude_pattern=None,
 
2237
             strict=False,
 
2238
             ):
2225
2239
    """Run the whole test suite under the enhanced runner"""
2226
2240
    # XXX: Very ugly way to do this...
2227
2241
    # Disable warning about old formats because we don't want it to disturb
2247
2261
                     matching_tests_first=matching_tests_first,
2248
2262
                     list_only=list_only,
2249
2263
                     random_seed=random_seed,
2250
 
                     exclude_pattern=exclude_pattern)
 
2264
                     exclude_pattern=exclude_pattern,
 
2265
                     strict=strict)
2251
2266
    finally:
2252
2267
        default_transport = old_transport
2253
2268