added release.txt blurb. Fixed spelling typo in Defaults.xml
[scons.git] / test / runtest / testargv.py
blob20dcdc848ea3133738a6f272eac1174d02aff8dd
1 #!/usr/bin/env python
3 # MIT License
5 # Copyright The SCons Foundation
7 # Permission is hereby granted, free of charge, to any person obtaining
8 # a copy of this software and associated documentation files (the
9 # "Software"), to deal in the Software without restriction, including
10 # without limitation the rights to use, copy, modify, merge, publish,
11 # distribute, sublicense, and/or sell copies of the Software, and to
12 # permit persons to whom the Software is furnished to do so, subject to
13 # the following conditions:
15 # The above copyright notice and this permission notice shall be included
16 # in all copies or substantial portions of the Software.
18 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
19 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 """
27 Test subdir args for runtest.py, for example:
29 python runtest.py test/subdir
31 """
33 import os
35 import TestRuntest
37 test = TestRuntest.TestRuntest()
38 test.subdir('test', ['test', 'subdir'])
40 pythonstring = TestRuntest.pythonstring
41 pythonflags = TestRuntest.pythonflags
43 one = os.path.join('test', 'subdir', 'test_one.py')
44 two = os.path.join('test', 'subdir', 'two.py')
45 three = os.path.join('test', 'test_three.py')
47 test.write_passing_test(['test', 'subdir', 'test_one.py'])
48 test.write_passing_test(['test', 'subdir', 'two.py'])
49 test.write_passing_test(['test', 'test_three.py'])
51 expect_stdout = f"""\
52 {pythonstring}{pythonflags} {one}
53 PASSING TEST STDOUT
54 {pythonstring}{pythonflags} {two}
55 PASSING TEST STDOUT
56 """
58 expect_stderr = """\
59 PASSING TEST STDERR
60 PASSING TEST STDERR
61 """
63 test.run(
64 arguments='--no-progress test/subdir',
65 status=0,
66 stdout=expect_stdout,
67 stderr=expect_stderr,
70 test.pass_test()
72 # Local Variables:
73 # tab-width:4
74 # indent-tabs-mode:nil
75 # End:
76 # vim: set expandtab tabstop=4 shiftwidth=4: