~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/benchmarks/__init__.py

  • Committer: Aaron Bentley
  • Date: 2006-07-11 13:17:16 UTC
  • mfrom: (1850 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1858.
  • Revision ID: abentley@panoramicfeedback.com-20060711131716-5ff677f3099e48b6
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Benchmark test suite for bzr."""
19
19
 
20
 
import bzrlib
 
20
from bzrlib import bzrdir, plugin
21
21
from bzrlib.tests.TestUtil import TestLoader
22
 
from bzrlib.bzrdir import BzrDir
23
22
from bzrlib.tests.blackbox import ExternalBase
24
23
 
 
24
 
25
25
class Benchmark(ExternalBase):
26
26
 
27
27
    def make_kernel_like_tree(self, url=None):
35
35
        # we simulate this by three levels of dirs named 0-7, givin 512 dirs,
36
36
        # and 20 files each.
37
37
        if url is not None:
38
 
            b = bzrlib.bzrdir.BzrDir.create_branch_convenience(url)
39
 
            d = bzrlib.bzrdir.BzrDir.create('.')
 
38
            b = bzrdir.BzrDir.create_branch_convenience(url)
 
39
            d = bzrdir.BzrDir.create('.')
40
40
            bzrlib.branch.BranchReferenceFormat().initialize(d, b)
41
41
            d.create_workingtree()
42
42
        else:
118
118
                   'bzrlib.benchmarks.bench_transform',
119
119
                   'bzrlib.benchmarks.bench_workingtree',
120
120
                   ]
121
 
    return TestLoader().loadTestsFromModuleNames(testmod_names)
 
121
    suite = TestLoader().loadTestsFromModuleNames(testmod_names) 
 
122
 
 
123
    # Load any benchmarks from plugins
 
124
    for name, module in plugin.all_plugins().items():
 
125
        if getattr(module, 'bench_suite', None) is not None:
 
126
            suite.addTest(module.bench_suite())
 
127
 
 
128
    return suite