~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/__init__.py

  • Committer: Robert Collins
  • Date: 2005-09-30 02:54:51 UTC
  • mfrom: (1395)
  • mto: This revision was merged to the branch mainline in revision 1397.
  • Revision ID: robertc@robertcollins.net-20050930025451-47b9e412202be44b
symlink and weaves, whaddya know

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
import errno
25
25
import subprocess
26
26
import shutil
 
27
 
27
28
import testsweet
28
 
 
29
29
import bzrlib.commands
30
30
import bzrlib.trace
31
31
import bzrlib.fetch
68
68
 
69
69
        hdlr = logging.StreamHandler(self._log_file)
70
70
        hdlr.setLevel(logging.DEBUG)
71
 
        hdlr.setFormatter(logging.Formatter('%(levelname)4.4s  %(message)s'))
 
71
        hdlr.setFormatter(logging.Formatter('%(levelname)8s  %(message)s'))
72
72
        logging.getLogger('').addHandler(hdlr)
73
73
        logging.getLogger('').setLevel(logging.DEBUG)
74
74
        self._log_hdlr = hdlr
153
153
        return self.run_bzr_captured(args, retcode)
154
154
 
155
155
    def check_inventory_shape(self, inv, shape):
156
 
        """
157
 
        Compare an inventory to a list of expected names.
 
156
        """Compare an inventory to a list of expected names.
158
157
 
159
158
        Fail if they are not precisely equal.
160
159
        """
259
258
        super(TestCaseInTempDir, self).setUp()
260
259
        self._make_test_root()
261
260
        self._currentdir = os.getcwdu()
262
 
        self.test_dir = os.path.join(self.TEST_ROOT, self.id())
 
261
        short_id = self.id().replace('bzrlib.selftest.', '') \
 
262
                   .replace('__main__.', '')
 
263
        self.test_dir = os.path.join(self.TEST_ROOT, short_id)
263
264
        os.mkdir(self.test_dir)
264
265
        os.chdir(self.test_dir)
265
266
        
296
297
 
297
298
 
298
299
def selftest(verbose=False, pattern=".*"):
 
300
    """Run the whole test suite under the enhanced runner"""
299
301
    return testsweet.run_suite(test_suite(), 'testbzr', verbose=verbose, pattern=pattern)
300
302
 
301
303
 
302
304
def test_suite():
 
305
    """Build and return TestSuite for the whole program."""
303
306
    from bzrlib.selftest.TestUtil import TestLoader, TestSuite
304
307
    import bzrlib, bzrlib.store, bzrlib.inventory, bzrlib.branch
305
308
    import bzrlib.osutils, bzrlib.commands, bzrlib.merge3, bzrlib.plugin
309
312
 
310
313
    testmod_names = \
311
314
                  ['bzrlib.selftest.MetaTestLog',
312
 
                   'bzrlib.selftest.test_parent',
313
315
                   'bzrlib.selftest.testinv',
314
 
                   'bzrlib.selftest.testfetch',
 
316
                   'bzrlib.selftest.test_ancestry',
 
317
                   'bzrlib.selftest.test_commit',
 
318
                   'bzrlib.selftest.test_commit_merge',
315
319
                   'bzrlib.selftest.versioning',
316
 
                   'bzrlib.selftest.whitebox',
317
320
                   'bzrlib.selftest.testmerge3',
318
321
                   'bzrlib.selftest.testmerge',
319
322
                   'bzrlib.selftest.testhashcache',
320
323
                   'bzrlib.selftest.teststatus',
321
324
                   'bzrlib.selftest.testlog',
322
 
                   'bzrlib.selftest.blackbox',
323
325
                   'bzrlib.selftest.testrevisionnamespaces',
324
326
                   'bzrlib.selftest.testbranch',
325
327
                   'bzrlib.selftest.testremotebranch',
329
331
                   'bzrlib.selftest.test_smart_add',
330
332
                   'bzrlib.selftest.test_bad_files',
331
333
                   'bzrlib.selftest.testdiff',
 
334
                   'bzrlib.selftest.test_parent',
332
335
                   'bzrlib.selftest.test_xml',
333
 
                   'bzrlib.fetch',
 
336
                   'bzrlib.selftest.test_weave',
 
337
                   'bzrlib.selftest.testfetch',
 
338
                   'bzrlib.selftest.whitebox',
334
339
                   'bzrlib.selftest.teststore',
 
340
                   'bzrlib.selftest.blackbox',
335
341
                   'bzrlib.selftest.testgraph',
336
342
                   ]
337
343