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:
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
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.
25 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
28 Test that use of env.SourceSignatures() correctly overrides the
38 test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
40 base_sconstruct_contents = """\
41 SetOption('warn', 'no-deprecated-source-signatures')
42 def build(env, target, source):
43 open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read())
44 B = Builder(action = build)
45 env = Environment(BUILDERS = { 'B' : B })
47 env2.SourceSignatures('%s')
48 env.B(target = 'f1.out', source = 'f1.in')
49 env.B(target = 'f2.out', source = 'f2.in')
50 env2.B(target = 'f3.out', source = 'f3.in')
51 env2.B(target = 'f4.out', source = 'f4.in')
53 SourceSignatures('%s')
56 def write_SConstruct(test, env_sigtype, default_sigtype):
57 contents = base_sconstruct_contents % (env_sigtype, default_sigtype)
58 test.write('SConstruct', contents)
62 write_SConstruct(test, 'MD5', 'timestamp')
64 test.write('f1.in', "f1.in\n")
65 test.write('f2.in', "f2.in\n")
66 test.write('f3.in', "f3.in\n")
67 test.write('f4.in', "f4.in\n")
69 test.run(arguments = 'f1.out f3.out',
70 stderr = TestSCons.deprecated_python_expr)
72 test.run(arguments = 'f1.out f2.out f3.out f4.out',
73 stdout = re.escape(test.wrap_stdout("""\
74 scons: `f1.out' is up to date.
75 build(["f2.out"], ["f2.in"])
76 scons: `f3.out' is up to date.
77 build(["f4.out"], ["f4.in"])
79 stderr = TestSCons.deprecated_python_expr)
88 test.run(arguments = 'f1.out f2.out f3.out f4.out',
89 stdout = re.escape(test.wrap_stdout("""\
90 build(["f1.out"], ["f1.in"])
91 scons: `f2.out' is up to date.
92 scons: `f3.out' is up to date.
93 scons: `f4.out' is up to date.
95 stderr = TestSCons.deprecated_python_expr)
97 test.up_to_date(arguments = 'f1.out f2.out f3.out f4.out', stderr = None)