~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2008-08-25 21:50:11 UTC
  • mfrom: (0.11.3 tools)
  • mto: This revision was merged to the branch mainline in revision 3659.
  • Revision ID: john@arbash-meinel.com-20080825215011-de9esmzgkue3e522
Merge in Lukáš's helper scripts.
Update the packaging documents to describe how to do the releases
using bzr-builddeb to package all distro platforms
simultaneously.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
                          TestUIFactory,
35
35
                          TestSkipped,
36
36
                          )
37
 
from bzrlib.symbol_versioning import (
38
 
    zero_eighteen,
39
 
    )
40
37
from bzrlib.tests.blackbox import ExternalBase
41
38
 
42
39
 
174
171
    def test_benchmark_runs_benchmark_tests(self):
175
172
        """bzr selftest --benchmark should not run the default test suite."""
176
173
        # We test this by passing a regression test name to --benchmark, which
177
 
        # should result in 0 rests run.
 
174
        # should result in 0 tests run.
178
175
        old_root = TestCaseWithMemoryTransport.TEST_ROOT
179
176
        try:
180
177
            TestCaseWithMemoryTransport.TEST_ROOT = None
260
257
class TestRunBzrSubprocess(TestCaseWithTransport):
261
258
 
262
259
    def test_run_bzr_subprocess(self):
263
 
        """The run_bzr_helper_external comand behaves nicely."""
 
260
        """The run_bzr_helper_external command behaves nicely."""
264
261
        result = self.run_bzr_subprocess('--version')
265
262
        result = self.run_bzr_subprocess(['--version'])
266
263
        result = self.run_bzr_subprocess('--version', retcode=None)
274
271
                                      'magic merge'], retcode=3)[1]
275
272
        self.assertContainsRe(err, 'Bad value "magic merge" for option'
276
273
                              ' "merge-type"')
277
 
        self.callDeprecated(['passing varargs to run_bzr_subprocess was'
278
 
                             ' deprecated in version 0.91.'],
279
 
                            self.run_bzr_subprocess,
280
 
                            'arg1', 'arg2', 'arg3', retcode=3)
281
274
 
282
275
    def test_run_bzr_subprocess_env(self):
283
276
        """run_bzr_subprocess can set environment variables in the child only.
558
551
            out_rand2.splitlines(), 2)
559
552
        self.assertEqual(tests_rand, tests_rand2)
560
553
 
 
554
 
 
555
class TestSelftestWithIdList(TestCaseInTempDir):
 
556
 
 
557
    def test_load_list(self):
 
558
        # We don't want to call selftest for the whole suite, so we start with
 
559
        # a reduced list.
 
560
        test_list_fname = 'test.list'
 
561
        fl = open(test_list_fname, 'wt')
 
562
        fl.write('%s\n' % self.id())
 
563
        fl.close()
 
564
        out, err = self.run_bzr(
 
565
            ['selftest', '--load-list', test_list_fname, '--list'])
 
566
        self.assertContainsRe(out, "Listed 1 test in")
 
567
 
 
568
    def test_load_unknown(self):
 
569
        out, err = self.run_bzr('selftest --load-list I_do_not_exist ',
 
570
                                retcode=3)
 
571
 
 
572
 
 
573
class TestSelftestStartingWith(TestCase):
 
574
 
 
575
    def test_starting_with(self):
 
576
        out, err = self.run_bzr(
 
577
            ['selftest', '--starting-with', self.id(), '--list'])
 
578
        self.assertContainsRe(out, "Listed 1 test in")
 
579
        self.assertContainsRe(out, self.id())
 
580