~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_selftest.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-07-16 14:02:58 UTC
  • mfrom: (5346.2.3 doc)
  • Revision ID: pqm@pqm.ubuntu.com-20100716140258-js1p8i24w8nodz6t
(mbp) developer docs about transports and symlinks (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""UI tests for the test framework."""
18
18
 
19
19
from bzrlib import (
 
20
    benchmarks,
20
21
    tests,
21
22
    )
22
23
from bzrlib.tests import (
45
46
            tests.selftest = original_selftest
46
47
 
47
48
 
 
49
class TestOptionsWritingToDisk(tests.TestCaseInTempDir, SelfTestPatch):
 
50
 
 
51
    def test_benchmark_runs_benchmark_tests(self):
 
52
        """selftest --benchmark should change the suite factory."""
 
53
        params = self.get_params_passed_to_core('selftest --benchmark')
 
54
        self.assertEqual(benchmarks.test_suite,
 
55
            params[1]['test_suite_factory'])
 
56
        self.assertNotEqual(None, params[1]['bench_history'])
 
57
        benchfile = open(".perf_history", "rt")
 
58
        try:
 
59
            lines = benchfile.readlines()
 
60
        finally:
 
61
            benchfile.close()
 
62
        # Because we don't run the actual test code no output is made to the
 
63
        # file.
 
64
        self.assertEqual(0, len(lines))
 
65
 
 
66
 
48
67
class TestOptions(tests.TestCase, SelfTestPatch):
49
68
 
50
69
    def test_load_list(self):