52
52
ue_scenarios = [('dirstate_Python',
53
53
{'update_entry': dirstate.py_update_entry})]
54
if compiled_dirstate_helpers.available():
55
update_entry = compiled_dirstate_helpers.module.update_entry
54
if compiled_dirstate_helpers_feature.available():
55
update_entry = compiled_dirstate_helpers_feature.module.update_entry
56
56
pyrex_scenario = ('dirstate_Pyrex', {'update_entry': update_entry})
57
57
ue_scenarios.append(pyrex_scenario)
58
58
process_entry_tests, remaining_tests = tests.split_suite_by_condition(
65
65
pe_scenarios = [('dirstate_Python',
66
66
{'_process_entry': dirstate.ProcessEntryPython})]
67
if compiled_dirstate_helpers.available():
68
process_entry = compiled_dirstate_helpers.module.ProcessEntryC
67
if compiled_dirstate_helpers_feature.available():
68
process_entry = compiled_dirstate_helpers_feature.module.ProcessEntryC
69
69
pyrex_scenario = ('dirstate_Pyrex', {'_process_entry': process_entry})
70
70
pe_scenarios.append(pyrex_scenario)
71
71
process_entry_tests, remaining_tests = tests.split_suite_by_condition(
253
253
class TestCompiledBisectPathLeft(TestBisectPathLeft):
254
254
"""Run all Bisect Path tests against _bisect_path_lect"""
256
_test_needs_features = [compiled_dirstate_helpers]
256
_test_needs_features = [compiled_dirstate_helpers_feature]
258
258
def get_bisect_path(self):
259
259
from bzrlib._dirstate_helpers_pyx import _bisect_path_left
274
274
class TestCompiledBisectPathRight(TestBisectPathRight):
275
275
"""Run all Bisect Path tests against _bisect_path_right"""
277
_test_needs_features = [compiled_dirstate_helpers]
277
_test_needs_features = [compiled_dirstate_helpers_feature]
279
279
def get_bisect_path(self):
280
280
from bzrlib._dirstate_helpers_pyx import _bisect_path_right
508
508
class TestCompiledCmpByDirs(TestCmpByDirs):
509
509
"""Test the pyrex implementation of cmp_by_dirs"""
511
_test_needs_features = [compiled_dirstate_helpers]
511
_test_needs_features = [compiled_dirstate_helpers_feature]
513
513
def get_cmp_by_dirs(self):
514
514
from bzrlib._dirstate_helpers_pyx import cmp_by_dirs
659
659
class TestCompiledCmpPathByDirblock(TestCmpPathByDirblock):
660
660
"""Test the pyrex implementation of _cmp_path_by_dirblock"""
662
_test_needs_features = [compiled_dirstate_helpers]
662
_test_needs_features = [compiled_dirstate_helpers_feature]
664
664
def get_cmp_by_dirs(self):
665
665
from bzrlib._dirstate_helpers_pyx import _cmp_path_by_dirblock
669
669
class TestMemRChr(tests.TestCase):
670
670
"""Test memrchr functionality"""
672
_test_needs_features = [compiled_dirstate_helpers]
672
_test_needs_features = [compiled_dirstate_helpers_feature]
674
674
def assertMemRChr(self, expected, s, c):
675
675
from bzrlib._dirstate_helpers_pyx import _py_memrchr
757
757
class TestCompiledReadDirblocks(TestReadDirblocks):
758
758
"""Test the pyrex implementation of _read_dirblocks"""
760
_test_needs_features = [compiled_dirstate_helpers]
760
_test_needs_features = [compiled_dirstate_helpers_feature]
762
762
def get_read_dirblocks(self):
763
763
from bzrlib._dirstate_helpers_pyx import _read_dirblocks
775
775
def test_bisect_dirblock(self):
776
if compiled_dirstate_helpers.available():
776
if compiled_dirstate_helpers_feature.available():
777
777
from bzrlib._dirstate_helpers_pyx import bisect_dirblock
779
779
from bzrlib._dirstate_helpers_py import bisect_dirblock
780
780
self.assertIs(bisect_dirblock, dirstate.bisect_dirblock)
782
782
def test__bisect_path_left(self):
783
if compiled_dirstate_helpers.available():
783
if compiled_dirstate_helpers_feature.available():
784
784
from bzrlib._dirstate_helpers_pyx import _bisect_path_left
786
786
from bzrlib._dirstate_helpers_py import _bisect_path_left
787
787
self.assertIs(_bisect_path_left, dirstate._bisect_path_left)
789
789
def test__bisect_path_right(self):
790
if compiled_dirstate_helpers.available():
790
if compiled_dirstate_helpers_feature.available():
791
791
from bzrlib._dirstate_helpers_pyx import _bisect_path_right
793
793
from bzrlib._dirstate_helpers_py import _bisect_path_right
794
794
self.assertIs(_bisect_path_right, dirstate._bisect_path_right)
796
796
def test_cmp_by_dirs(self):
797
if compiled_dirstate_helpers.available():
797
if compiled_dirstate_helpers_feature.available():
798
798
from bzrlib._dirstate_helpers_pyx import cmp_by_dirs
800
800
from bzrlib._dirstate_helpers_py import cmp_by_dirs
801
801
self.assertIs(cmp_by_dirs, dirstate.cmp_by_dirs)
803
803
def test__read_dirblocks(self):
804
if compiled_dirstate_helpers.available():
804
if compiled_dirstate_helpers_feature.available():
805
805
from bzrlib._dirstate_helpers_pyx import _read_dirblocks
807
807
from bzrlib._dirstate_helpers_py import _read_dirblocks
808
808
self.assertIs(_read_dirblocks, dirstate._read_dirblocks)
810
810
def test_update_entry(self):
811
if compiled_dirstate_helpers.available():
811
if compiled_dirstate_helpers_feature.available():
812
812
from bzrlib._dirstate_helpers_pyx import update_entry
814
814
from bzrlib.dirstate import update_entry
815
815
self.assertIs(update_entry, dirstate.update_entry)
817
817
def test_process_entry(self):
818
if compiled_dirstate_helpers.available():
818
if compiled_dirstate_helpers_feature.available():
819
819
from bzrlib._dirstate_helpers_pyx import ProcessEntryC
820
820
self.assertIs(ProcessEntryC, dirstate._process_entry)