627
627
register_command(cmd_gselftest)
630
class cmd_test_gtk(GTKCommand):
631
"""Version of selftest that just runs the gtk test suite."""
633
takes_options = ['verbose',
634
Option('one', short_name='1',
635
help='Stop when one test fails.'),
636
Option('benchmark', help='Run the benchmarks.'),
637
Option('lsprof-timed',
638
help='Generate lsprof output for benchmarked'
639
' sections of code.'),
641
help='List the tests instead of running them.'),
642
Option('randomize', type=str, argname="SEED",
643
help='Randomize the order of tests using the given'
644
' seed or "now" for the current time.'),
646
takes_args = ['testspecs*']
648
def run(self, verbose=None, one=False, benchmark=None,
649
lsprof_timed=None, list_only=False, randomize=None,
650
testspecs_list=None):
651
from bzrlib import __path__ as bzrlib_path
652
from bzrlib.tests import selftest
654
print '%10s: %s' % ('bzrlib', bzrlib_path[0])
656
print 'No benchmarks yet'
659
test_suite_factory = bench_suite
662
# TODO: should possibly lock the history file...
663
benchfile = open(".perf_history", "at", buffering=1)
665
test_suite_factory = test_suite
670
if testspecs_list is not None:
671
pattern = '|'.join(testspecs_list)
676
result = selftest(verbose=verbose,
679
test_suite_factory=test_suite_factory,
680
lsprof_timed=lsprof_timed,
681
bench_history=benchfile,
683
random_seed=randomize,
686
if benchfile is not None:
689
register_command(cmd_test_gtk)
694
631
gettext.install('olive-gtk')