[merge] allow plugins to create benchmarks

Martin Pool mbp at canonical.com
Thu Jul 6 03:01:41 BST 2006


On  5 Jul 2006, John Arbash Meinel <john at arbash-meinel.com> wrote:
> With my recent dirstate testing, it would be a lot nicer to run things
> as benchmarks, rather than running them as plain tests.
> 
> So the attached patch updates bzr.dev so that plugins can provide a
> 'bench_suite()' function, to go alongside their 'test_suite()' function.

+1

> +    # Load any benchmarks from plugins
> +    for name, plugin in bzrlib.plugin.all_plugins().items():
> +        if getattr(plugin, 'bench_suite', None) is not None:
> +            suite.addTest(plugin.bench_suite())
> +
> +    return suite

The recent discussion of standard import style comes up here again.
>From what we just said, this should be 'from bzrlib import plugin', but
then you can't use the name 'plugin' as a local variable, which is a bit
unfortunate.  So, change it if you want but we can merge anyhow.

-- 
Martin




More information about the bazaar mailing list