~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/cmd_test_script.py

  • Committer: Vincent Ladeuil
  • Date: 2010-11-08 10:53:53 UTC
  • mto: (5532.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 5532.
  • Revision ID: v.ladeuil+lp@free.fr-20101108105353-nntejqprr3nislcw
Implements --null-ouput for the test-script command.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
import os
24
24
 
25
 
from bzrlib import commands
 
25
from bzrlib import (
 
26
    commands,
 
27
    option,
 
28
    )
26
29
 
27
30
 
28
31
class cmd_test_script(commands.Command):
30
33
 
31
34
    hidden = True
32
35
    takes_args = ['infile']
 
36
    takes_options = [
 
37
        option.Option('null-output',
 
38
                       help='Null command outputs match any output.'),
 
39
        ]
33
40
 
34
41
    @commands.display_command
35
 
    def run(self, infile):
 
42
    def run(self, infile, null_output=False):
36
43
        # local imports to defer testtools dependency
37
44
        from bzrlib import tests
38
45
        from bzrlib.tests.script import TestCaseWithTransportAndScript
48
55
            script = None # Set before running
49
56
 
50
57
            def test_it(self):
51
 
                self.run_script(script)
 
58
                self.run_script(script,
 
59
                                null_output_matches_anything=null_output)
52
60
 
53
61
        runner = tests.TextTestRunner(stream=self.outf)
54
62
        test = Test('test_it')