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.
27 Test the Pseudo method
32 test
= TestSCons
.TestSCons()
34 test
.write('SConstruct', """\
36 foo = env.Command('foo.out', [], '@echo boo')
37 bar = env.Command('bar.out', [], Touch('$TARGET'))
40 gfoo = Command('foo.glb', [], '@echo boo')
41 gbar = Command('bar.glb', [], Touch('$TARGET'))
45 # foo.out build does not create file, should generate no errors
46 test
.run(arguments
='-Q foo.out', stdout
='boo\n')
47 # missing target warning triggers if requested
48 test
.run(arguments
='-Q foo.out --warning=target-not-built', stdout
="boo\n")
49 # bar.out build creates file, error if it exists after the build
50 test
.run(arguments
='-Q bar.out', stdout
='Touch("bar.out")\n', stderr
=None, status
=2)
51 test
.must_contain_all_lines(
53 'scons: *** Pseudo target bar.out must not exist',
55 # warning must not appear since target created
57 arguments
='-Q bar.out --warning=target-not-built',
58 stdout
='Touch("bar.out")\n',
62 test
.must_contain_all_lines(
64 'scons: *** Pseudo target bar.out must not exist',
67 # repeat the process for the global function form (was missing initially)
68 test
.run(arguments
='-Q foo.glb', stdout
='boo\n')
69 test
.run(arguments
='-Q foo.glb --warning=target-not-built', stdout
="boo\n")
70 test
.run(arguments
='-Q bar.glb', stdout
='Touch("bar.glb")\n', stderr
=None, status
=2)
71 test
.must_contain_all_lines(
73 'scons: *** Pseudo target bar.glb must not exist',
76 arguments
='-Q bar.glb --warning=target-not-built',
77 stdout
='Touch("bar.glb")\n',
81 test
.must_contain_all_lines(
83 'scons: *** Pseudo target bar.glb must not exist',
90 # indent-tabs-mode:nil
92 # vim: set expandtab tabstop=4 shiftwidth=4: