/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

Merge bzr.dev to resolve conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
489
489
        return self._shortened_test_description(test)
490
490
 
491
491
    def report_error(self, test, err):
492
 
        self.ui.note('ERROR: %s\n    %s\n' % (
 
492
        self.stream.write('ERROR: %s\n    %s\n' % (
493
493
            self._test_description(test),
494
494
            err[1],
495
495
            ))
496
496
 
497
497
    def report_failure(self, test, err):
498
 
        self.ui.note('FAIL: %s\n    %s\n' % (
 
498
        self.stream.write('FAIL: %s\n    %s\n' % (
499
499
            self._test_description(test),
500
500
            err[1],
501
501
            ))
3284
3284
        bzr_path = [bzr_path]
3285
3285
        if sys.platform == "win32":
3286
3286
            # if we're on windows, we can't execute the bzr script directly
3287
 
            bzr_path = [sys.executable] + bzr_path
 
3287
            # and we have to enable unbuffered binary stdout/stderr so that
 
3288
            # automatic CRLF conversion doesn't corrupt the subunit streams
 
3289
            bzr_path = [sys.executable, '-u'] + bzr_path
3288
3290
        fd, test_list_file_name = tempfile.mkstemp()
3289
3291
        test_list_file = os.fdopen(fd, 'wb', 1)
3290
3292
        for test in process_tests:
3619
3621
        'bzrlib.tests.commands',
3620
3622
        'bzrlib.tests.per_branch',
3621
3623
        'bzrlib.tests.per_bzrdir',
 
3624
        'bzrlib.tests.per_bzrdir_colo',
3622
3625
        'bzrlib.tests.per_foreign_vcs',
3623
3626
        'bzrlib.tests.per_interrepository',
3624
3627
        'bzrlib.tests.per_intertree',
4445
4448
            return result
4446
4449
except ImportError:
4447
4450
    pass
 
4451
 
 
4452
class _PosixPermissionsFeature(Feature):
 
4453
 
 
4454
    def _probe(self):
 
4455
        def has_perms():
 
4456
            # create temporary file and check if specified perms are maintained.
 
4457
            import tempfile
 
4458
 
 
4459
            write_perms = stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR
 
4460
            f = tempfile.mkstemp(prefix='bzr_perms_chk_')
 
4461
            fd, name = f
 
4462
            os.close(fd)
 
4463
            os.chmod(name, write_perms)
 
4464
 
 
4465
            read_perms = os.stat(name).st_mode & 0777
 
4466
            os.unlink(name)
 
4467
            return (write_perms == read_perms)
 
4468
 
 
4469
        return (os.name == 'posix') and has_perms()
 
4470
 
 
4471
    def feature_name(self):
 
4472
        return 'POSIX permissions support'
 
4473
 
 
4474
posix_permissions_feature = _PosixPermissionsFeature()