/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Martin Pool
  • Date: 2009-08-20 05:05:59 UTC
  • mfrom: (4630 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4632.
  • Revision ID: mbp@sourcefrog.net-20090820050559-021d8swx2ps1xfn7
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
2344
2344
 
2345
2345
    def _getTestDirPrefix(self):
2346
2346
        # create a directory within the top level test directory
2347
 
        if sys.platform == 'win32':
 
2347
        if sys.platform in ('win32', 'cygwin'):
2348
2348
            name_prefix = re.sub('[<>*=+",:;_/\\-]', '_', self.id())
2349
2349
            # windows is likely to have path-length limits so use a short name
2350
2350
            name_prefix = name_prefix[-30:]
2798
2798
        decorators.append(filter_tests(pattern))
2799
2799
    if suite_decorators:
2800
2800
        decorators.extend(suite_decorators)
2801
 
    # tell the result object how many tests will be running:
2802
 
    decorators.append(CountingDecorator)
 
2801
    # tell the result object how many tests will be running: (except if
 
2802
    # --parallel=fork is being used. Robert said he will provide a better
 
2803
    # progress design later -- vila 20090817)
 
2804
    if fork_decorator not in decorators:
 
2805
        decorators.append(CountingDecorator)
2803
2806
    for decorator in decorators:
2804
2807
        suite = decorator(suite)
2805
2808
    result = runner.run(suite)
3431
3434
                   'bzrlib.tests.per_repository',
3432
3435
                   'bzrlib.tests.per_repository_chk',
3433
3436
                   'bzrlib.tests.per_repository_reference',
 
3437
                   'bzrlib.tests.per_versionedfile',
3434
3438
                   'bzrlib.tests.per_workingtree',
3435
3439
                   'bzrlib.tests.test__annotator',
3436
3440
                   'bzrlib.tests.test__chk_map',
3583
3587
                   'bzrlib.tests.test_urlutils',
3584
3588
                   'bzrlib.tests.test_version',
3585
3589
                   'bzrlib.tests.test_version_info',
3586
 
                   'bzrlib.tests.test_versionedfile',
3587
3590
                   'bzrlib.tests.test_weave',
3588
3591
                   'bzrlib.tests.test_whitebox',
3589
3592
                   'bzrlib.tests.test_win32utils',
3816
3819
    try:
3817
3820
        osutils.rmtree(dirname)
3818
3821
    except OSError, e:
3819
 
        if sys.platform == 'win32' and e.errno == errno.EACCES:
3820
 
            sys.stderr.write('Permission denied: '
3821
 
                             'unable to remove testing dir '
3822
 
                             '%s\n%s'
3823
 
                             % (os.path.basename(dirname), e))
3824
 
        else:
3825
 
            raise
 
3822
        # We don't want to fail here because some useful display will be lost
 
3823
        # otherwise. Polluting the tmp dir is bad, but not giving all the
 
3824
        # possible info to the test runner is even worse.
 
3825
        sys.stderr.write('Unable to remove testing dir %s\n%s'
 
3826
                         % (os.path.basename(dirname), e))
3826
3827
 
3827
3828
 
3828
3829
class Feature(object):