|
28 | 28 | import TestCmd |
29 | 29 | import TestSCons |
30 | 30 |
|
31 | | -test = TestSCons.TestSCons(match = TestCmd.match_re_dotall,ignore_python_version=0) |
| 31 | +test = TestSCons.TestSCons(match=TestCmd.match_re_dotall, ignore_python_version=False) |
32 | 32 |
|
33 | 33 | wpath = test.workpath() |
34 | 34 |
|
35 | 35 | test.write('SConstruct', r""" |
36 | 36 | Help("Help text.\n") |
37 | 37 | """) |
38 | 38 |
|
39 | | -expect = """scons: Reading SConscript files ... |
| 39 | +expect_help = """\ |
| 40 | +scons: Reading SConscript files ... |
40 | 41 | scons: done reading SConscript files. |
41 | 42 | Help text. |
42 | 43 |
|
|
45 | 46 |
|
46 | 47 | os.environ['SCONSFLAGS'] = '' |
47 | 48 |
|
48 | | -test.run(arguments = '-h', |
49 | | - stdout = expect, |
50 | | - stderr = TestSCons.deprecated_python_expr) |
| 49 | +test.run(arguments='-h', |
| 50 | + stdout=expect_help, |
| 51 | + stderr=TestSCons.deprecated_python_expr) |
51 | 52 |
|
52 | 53 | os.environ['SCONSFLAGS'] = '-h' |
53 | 54 |
|
54 | | -test.run(stdout = expect, |
55 | | - stderr = TestSCons.deprecated_python_expr) |
| 55 | +test.run(stdout=expect_help, |
| 56 | + stderr=TestSCons.deprecated_python_expr) |
56 | 57 |
|
57 | | -# No TestSCons.deprecated_python_expr because the -H option gets |
| 58 | +# Don't check for deprecated_python_expr because the -H option gets |
58 | 59 | # processed before the SConscript files and therefore before we check |
59 | 60 | # for the deprecation warning. |
60 | | -test.run(arguments = "-H") |
| 61 | +os.environ['SCONSFLAGS'] = '' |
| 62 | +test.run(arguments="-H") |
61 | 63 |
|
62 | 64 | test.must_not_contain_any_line(test.stdout(), ['Help text.']) |
63 | 65 | test.must_contain_all_lines(test.stdout(), ['-H, --help-options']) |
64 | 66 |
|
65 | | -expect = r"""usage: scons [OPTIONS] [VARIABLES] [TARGETS] |
| 67 | +expect_no_opt = TestSCons.deprecated_python_expr + \ |
| 68 | +r"""usage: scons \[OPTIONS\] \[VARIABLES\] \[TARGETS\] |
66 | 69 |
|
67 | 70 | SCons Error: no such option: -Z |
68 | 71 | """ |
69 | 72 |
|
70 | | -test.run(arguments="-Z", status=2, stderr=expect, match=TestSCons.match_exact) |
| 73 | +test.run(arguments="-Z", status=2, stdout=None, stderr=expect_no_opt) |
71 | 74 |
|
72 | 75 | os.environ['SCONSFLAGS'] = '-Z' |
73 | | -test.run(status=2, stderr=expect, match=TestSCons.match_exact) |
| 76 | +test.run(status=2, stdout=None, stderr=expect_no_opt) |
74 | 77 |
|
75 | 78 | test.pass_test() |
0 commit comments