607
609
register_command(cmd_gselftest)
612
class cmd_test_gtk(GTKCommand):
613
"""Version of selftest that just runs the gtk test suite."""
615
takes_options = ['verbose',
616
Option('one', short_name='1',
617
help='stop when one test fails'),
618
Option('benchmark', help='run the benchmarks.'),
619
Option('lsprof-timed',
620
help='generate lsprof output for benchmarked'
621
' sections of code.'),
623
help='list the tests instead of running them'),
624
Option('randomize', type=str, argname="SEED",
625
help='randomize the order of tests using the given'
626
' seed or "now" for the current time'),
628
takes_args = ['testspecs*']
630
def run(self, verbose=None, one=False, benchmark=None,
631
lsprof_timed=None, list_only=False, randomize=None,
632
testspecs_list=None):
633
from bzrlib import __path__ as bzrlib_path
634
from bzrlib.tests import selftest
636
print '%10s: %s' % ('bzrlib', bzrlib_path[0])
638
print 'No benchmarks yet'
641
test_suite_factory = bench_suite
644
# TODO: should possibly lock the history file...
645
benchfile = open(".perf_history", "at", buffering=1)
647
test_suite_factory = test_suite
652
if testspecs_list is not None:
653
pattern = '|'.join(testspecs_list)
658
result = selftest(verbose=verbose,
661
test_suite_factory=test_suite_factory,
662
lsprof_timed=lsprof_timed,
663
bench_history=benchfile,
665
random_seed=randomize,
668
if benchfile is not None:
671
register_command(cmd_test_gtk)
611
675
gettext.install('olive-gtk')