13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
17
"""Benchmark test suite for bzr."""
19
19
from bzrlib import (
22
from bzrlib import plugin as _mod_plugin
23
23
import bzrlib.branch
24
24
from bzrlib.tests.TestUtil import TestLoader
25
25
from bzrlib.tests.blackbox import ExternalBase
77
77
:param link_working: Instead of copying all of the working tree
78
78
files, just hardlink them to the cached files. Tests can unlink
79
79
files that they will change.
80
:param link_bzr: Hardlink the .bzr directory. For readonly
80
:param link_bzr: Hardlink the .bzr directory. For readonly
81
81
operations this is safe, and shaves off a lot of setup time
83
83
from bzrlib.benchmarks.tree_creator.kernel_like import (
104
104
def make_many_commit_tree(self, directory_name='.',
106
106
"""Create a tree with many commits.
108
No file changes are included. Not hardlinking the working tree,
108
No file changes are included. Not hardlinking the working tree,
109
109
because there are no working tree files.
111
111
from bzrlib.benchmarks.tree_creator.simple_many_commit import (
117
117
def make_heavily_merged_tree(self, directory_name='.',
119
119
"""Create a tree in which almost every commit is a merge.
121
No file changes are included. This produces two trees,
121
No file changes are included. This produces two trees,
122
122
one of which is returned. Except for the first commit, every
123
123
commit in its revision-history is a merge another commit in the other
124
tree. Not hardlinking the working tree, because there are no working
124
tree. Not hardlinking the working tree, because there are no working
127
127
from bzrlib.benchmarks.tree_creator.heavily_merged import (
185
185
'bzrlib.benchmarks.bench_inventory',
186
186
'bzrlib.benchmarks.bench_knit',
187
187
'bzrlib.benchmarks.bench_log',
188
'bzrlib.benchmarks.bench_pack',
189
188
'bzrlib.benchmarks.bench_osutils',
190
189
'bzrlib.benchmarks.bench_rocks',
191
190
'bzrlib.benchmarks.bench_startup',
192
191
'bzrlib.benchmarks.bench_status',
193
'bzrlib.benchmarks.bench_tags',
194
192
'bzrlib.benchmarks.bench_transform',
195
193
'bzrlib.benchmarks.bench_workingtree',
196
194
'bzrlib.benchmarks.bench_sftp',
197
195
'bzrlib.benchmarks.bench_xml',
199
suite = TestLoader().loadTestsFromModuleNames(testmod_names)
197
suite = TestLoader().loadTestsFromModuleNames(testmod_names)
201
199
# Load any benchmarks from plugins
202
for name, plugin in _mod_plugin.plugins().items():
203
if getattr(plugin.module, 'bench_suite', None) is not None:
204
suite.addTest(plugin.module.bench_suite())
200
for name, module in plugin.all_plugins().items():
201
if getattr(module, 'bench_suite', None) is not None:
202
suite.addTest(module.bench_suite())