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__"
29 test = TestSCons.TestSCons()
31 test.pass_test() #XXX Short-circuit until this is supported.
35 test.write('SConstruct', """
37 env.Program(target = 'aaa', source = 'aaa.c')
38 env.Program(target = 'bbb', source = 'bbb.c')
39 SConscript('subdir/SConscript')
42 test.write(['subdir', 'SConscript'], """
44 env.Program(target = 'ccc', source = 'ccc.c')
45 env.Program(target = 'ddd', source = 'ddd.c')
48 test.write('aaa.c', """
50 main(int argc, char *argv)
58 test.write('bbb.c', """
60 main(int argc, char *argv)
68 test.write(['subdir', 'ccc.c'], """
70 main(int argc, char *argv)
73 printf("subdir/ccc.c\n");
78 test.write(['subdir', 'ddd.c'], """
80 main(int argc, char *argv)
83 printf("subdir/ddd.c\n");
88 test.run(arguments = '-d .', stdout = """
93 Rebuilding aaa.o: out of date.
95 Rebuilding aaa: out of date.
102 Rebuilding bbb.o: out of date.
104 Rebuilding bbb: out of date.
107 Target subdir/ccc/g: subdir/ccc.o
108 Checking subdir/ccc/g
109 Checking subdir/ccc/g.o
110 Checking subdir/ccc/g.c
111 Rebuilding subdir/ccc/g.o: out of date.
112 cc -c -o subdir/ccc/g.o subdir/ccc.c
113 Rebuilding subdir/ccc/g: out of date.
114 cc -o subdir/ccc/g subdir/ccc.o
115 Target subdir/ccc/g.o: subdir/ccc.c
116 Target subdir/ddd/g: subdir/ddd.o
117 Checking subdir/ddd/g
118 Checking subdir/ddd/g.o
119 Checking subdir/ddd/g.c
120 Rebuilding subdir/ddd/g.o: out of date.
121 cc -c -o subdir/ddd/g.o subdir/ddd.c
122 Rebuilding subdir/ddd/g: out of date.
123 cc -o subdir/ddd/g subdir/ddd.o
124 Target subdir/ddd/g.o: subdir/ddd.c
127 test.run(program = test.workpath('aaa'), stdout = "aaa.c\n")
128 test.run(program = test.workpath('bbb'), stdout = "bbb.c\n")
129 test.run(program = test.workpath('subdir/ccc'), stdout = "subdir/ccc.c\n")
130 test.run(program = test.workpath('subdir/ddd'), stdout = "subdir/ddd.c\n")