Mercurial > hgsubversion
comparison tests/run.py @ 688:073132fc27f1
tests: add --show-stdout option to run.py
| author | Peter Arrenbrecht <peter.arrenbrecht@gmail.com> |
|---|---|
| date | Wed, 08 Sep 2010 09:50:11 +0200 |
| parents | 8687c5aa4f35 |
| children | e9306b23d323 |
comparison
equal
deleted
inserted
replaced
| 687:d424bd1ac647 | 688:073132fc27f1 |
|---|---|
| 58 parser.add_option("", "--bindings", | 58 parser.add_option("", "--bindings", |
| 59 dest="bindings", action="store", default=None, | 59 dest="bindings", action="store", default=None, |
| 60 choices=["swig", "subvertpy"], | 60 choices=["swig", "subvertpy"], |
| 61 help="test using the specified bindings (swig or " | 61 help="test using the specified bindings (swig or " |
| 62 "subvertpy)") | 62 "subvertpy)") |
| 63 parser.add_option("", "--show-stdout", | |
| 64 dest="showstdout", action="store_true", default=False, | |
| 65 help="show stdout (hidden by default)") | |
| 63 | 66 |
| 64 (options, args) = parser.parse_args() | 67 (options, args) = parser.parse_args() |
| 65 | 68 |
| 66 if options.verbose: | 69 if options.verbose: |
| 67 testargs = { 'descriptions': 3, 'verbosity': 2 } | 70 testargs = { 'descriptions': 3, 'verbosity': 2 } |
| 80 # make sure our copy of hgsubversion gets imported by loading test_util | 83 # make sure our copy of hgsubversion gets imported by loading test_util |
| 81 import test_util | 84 import test_util |
| 82 test_util.TestBase | 85 test_util.TestBase |
| 83 | 86 |
| 84 # silence output when running outside nose | 87 # silence output when running outside nose |
| 85 import tempfile | 88 if not options.showstdout: |
| 86 sys.stdout = tempfile.TemporaryFile() | 89 import tempfile |
| 90 sys.stdout = tempfile.TemporaryFile() | |
| 87 | 91 |
| 88 all = tests() | 92 all = tests() |
| 89 | 93 |
| 90 args = [i.split('.py')[0].replace('-', '_') for i in args] | 94 args = [i.split('.py')[0].replace('-', '_') for i in args] |
| 91 | 95 |
