~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Robert Collins
  • Date: 2006-05-16 05:16:22 UTC
  • mto: (1713.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 1714.
  • Revision ID: robertc@robertcollins.net-20060516051622-807a8bbda673f4ee
'bzr selftest --benchmark' will run a new benchmarking selftest.
(Robert Collins, Martin Pool).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1779
1779
                            help='Use a different transport by default '
1780
1780
                                 'throughout the test suite.',
1781
1781
                            type=get_transport_type),
 
1782
                     Option('benchmark', help='run the bzr bencharks.'),
1782
1783
                    ]
1783
1784
 
1784
1785
    def run(self, testspecs_list=None, verbose=False, one=False,
1785
 
            keep_output=False, transport=None):
 
1786
            keep_output=False, transport=None, benchmark=None):
1786
1787
        import bzrlib.ui
1787
 
        from bzrlib.tests import selftest
 
1788
        from bzrlib.tests import selftest, benchmark_suite
1788
1789
        # we don't want progress meters from the tests to go to the
1789
1790
        # real output; and we don't want log messages cluttering up
1790
1791
        # the real logs.
1791
1792
        save_ui = bzrlib.ui.ui_factory
 
1793
        print '%10s: %s' % ('bzr', bzrlib.osutils.realpath(sys.argv[0]))
 
1794
        print '%10s: %s' % ('bzrlib', bzrlib.__path__[0])
 
1795
        print
1792
1796
        bzrlib.trace.info('running tests...')
1793
1797
        try:
1794
1798
            bzrlib.ui.ui_factory = bzrlib.ui.SilentUIFactory()
1796
1800
                pattern = '|'.join(testspecs_list)
1797
1801
            else:
1798
1802
                pattern = ".*"
 
1803
            if benchmark:
 
1804
                test_suite_factory = benchmark_suite
 
1805
            else:
 
1806
                test_suite_factory = None
1799
1807
            result = selftest(verbose=verbose, 
1800
1808
                              pattern=pattern,
1801
1809
                              stop_on_failure=one, 
1802
1810
                              keep_output=keep_output,
1803
 
                              transport=transport)
 
1811
                              transport=transport,
 
1812
                              test_suite_factory=test_suite_factory)
1804
1813
            if result:
1805
1814
                bzrlib.trace.info('tests passed')
1806
1815
            else: