30
32
def test_02_make_kernel_like_tree(self):
31
33
"""Hardlinking a kernel-like working tree should be ~1s"""
32
# Make sure we have populated the cache first
33
self.make_kernel_like_tree(root='foo', hardlink_working=True)
34
# make sure kernel_like_tree is cached
35
self._cache_kernel_like_tree()
34
36
self.time(self.make_kernel_like_tree, root='bar',
35
37
hardlink_working=True)
37
39
def test_03_make_kernel_like_added_tree(self):
38
40
"""Time the first creation of a kernel like added tree"""
39
# This may not be an accurate test, in the case that the cached entry
40
# has already been created
41
self.time(self.make_kernel_like_added_tree, root='foo')
41
orig_cache = Benchmark.CACHE_ROOT
43
# Change to a local cache directory so we know this
44
# really creates the files
45
Benchmark.CACHE_ROOT = osutils.abspath('cache')
46
self.time(self.make_kernel_like_added_tree, root='foo')
48
Benchmark.CACHE_ROOT = orig_cache
43
50
def test_04_make_kernel_like_added_tree(self):
44
51
"""Time the second creation of a kernel like added tree
45
52
(this should be a clone)
47
# Call make_kernel_like_added_tree to make sure it is cached
48
self.make_kernel_like_added_tree(root='foo')
54
# make sure kernel_like_added_tree is cached
55
self._cache_kernel_like_added_tree()
49
56
self.time(self.make_kernel_like_added_tree, root='bar')
51
58
def test_05_make_kernel_like_committed_tree(self):
52
59
"""Time the first creation of a committed kernel like tree"""
53
# This may not be an accurate test, in the case that the cached entry
54
# has already been created
55
self.time(self.make_kernel_like_committed_tree, root='foo')
60
orig_cache = Benchmark.CACHE_ROOT
62
# Change to a local cache directory so we know this
63
# really creates the files
64
Benchmark.CACHE_ROOT = osutils.abspath('cache')
65
self.time(self.make_kernel_like_committed_tree, root='foo')
67
Benchmark.CACHE_ROOT = orig_cache
57
69
def test_06_make_kernel_like_committed_tree(self):
58
70
"""Time the second creation of a committed kernel like tree
59
71
(this should be a clone)
61
73
# Call make_kernel_like_committed_tree to make sure it is cached
62
# we just throw it away, so hardlink the first bzr directory
63
self.make_kernel_like_committed_tree(root='foo', hardlink_bzr=True)
74
self._cache_kernel_like_committed_tree()
64
75
self.time(self.make_kernel_like_committed_tree, root='bar')
66
77
def test_07_make_kernel_like_committed_tree_hardlink(self):
67
78
"""Time the creation of a committed kernel like tree
68
79
(this should also hardlink the .bzr/ directory)
70
# Call make_kernel_like_committed_tree to make sure it is cached
71
self.make_kernel_like_committed_tree(root='foo', hardlink_bzr=True)
81
# make sure kernel_like_committed_tree is cached
82
self._cache_kernel_like_committed_tree()
72
83
self.time(self.make_kernel_like_committed_tree, root='bar',