Debian Codegraph @

test/scons-time/run/option/quiet.py

raw
1 #!/usr/bin/env python
2 #
3 # __COPYRIGHT__
4 #
5 # Permission is hereby granted, free of charge, to any person obtaining
6 # a copy of this software and associated documentation files (the
7 # "Software"), to deal in the Software without restriction, including
8 # without limitation the rights to use, copy, modify, merge, publish,
9 # distribute, sublicense, and/or sell copies of the Software, and to
10 # permit persons to whom the Software is furnished to do so, subject to
11 # the following conditions:
12 #
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
15 #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
17 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
18 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 #
24
25 """
26 Verify that the run -q and --quiet options suppress build output.
27 """
28
29 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
30
31 import re
32
33 import TestSCons_time
34
35 python = TestSCons_time.python
36
37 test = TestSCons_time.TestSCons_time(match=TestSCons_time.match_re,
38 diff=TestSCons_time.diff_re)
39
40 scons_py = re.escape(test.workpath('scripts', 'scons.py'))
41 src_engine = re.escape(test.workpath())
42
43 tmp_scons_time = test.tempdir_re()
44 tmp_scons_time_foo = test.tempdir_re('foo')
45
46
47 test.write_fake_scons_py()
48
49 foo_tar_gz = test.write_sample_project('foo.tar.gz')
50
51 expect = """\
52 %(scons_py)s
53 --version
54 SCONS_LIB_DIR = %(src_engine)s
55 SConstruct file directory: %(tmp_scons_time_foo)s
56 """ % locals()
57
58 test.run(arguments='run -q foo.tar.gz', stdout=expect)
59
60 test.must_exist('foo-000-0.log',
61 'foo-000-0.prof',
62 'foo-000-1.log',
63 'foo-000-1.prof',
64 'foo-000-2.log',
65 'foo-000-2.prof')
66
67 test.run(arguments='run -q foo.tar.gz', stdout=expect)
68
69 test.must_exist('foo-001-0.log',
70 'foo-001-0.prof',
71 'foo-001-1.log',
72 'foo-001-1.prof',
73 'foo-001-2.log',
74 'foo-001-2.prof')
75
76 test.run(arguments='run --quiet foo.tar.gz', stdout=expect)
77
78 test.pass_test()
79
80 # Local Variables:
81 # tab-width:4
82 # indent-tabs-mode:nil
83 # End:
84 # vim: set expandtab tabstop=4 shiftwidth=4: