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__"
30 if sys.platform == 'win32':
37 test = TestSCons.TestSCons()
40 test.subdir('repository', 'work')
43 workpath_repository = test.workpath('repository')
44 repository_foo = test.workpath('repository', 'foo' + _exe)
45 work_foo = test.workpath('work', 'foo' + _exe)
48 test.write(['repository', 'SConstruct'], """
51 env.Program(target = 'foo', source = ['aaa.c', 'bbb.c', 'foo.c'])
52 """ % workpath_repository)
54 test.write(['repository', 'aaa.c'], r"""
60 printf("repository/aaa.c\n");
64 test.write(['repository', 'bbb.c'], r"""
70 printf("repository/bbb.c\n");
74 test.write(['repository', 'foo.c'], r"""
77 extern void aaa(void);
78 extern void bbb(void);
80 main(int argc, char *argv[])
85 printf("repository/foo.c\n");
91 test.run(chdir = 'repository', arguments = ".")
93 test.run(program = repository_foo, stdout =
99 test.up_to_date(chdir = 'repository', arguments = ".")
101 # Make the repository non-writable,
102 # so we'll detect if we try to write into it accidentally.
103 test.writable('repository', 0)
106 test.write(['work', 'SConstruct'], """
109 env.Program(target = 'foo', source = ['aaa.c', 'bbb.c', 'foo.c'])
110 """ % workpath_repository)
112 test.up_to_date(chdir = 'work', arguments = ".")
115 test.write(['work', 'bbb.c'], r"""
121 printf("work/bbb.c\n");
126 test.run(chdir = 'work', arguments = ".")
128 test.run(program = work_foo, stdout =
134 test.up_to_date(chdir = 'work', arguments = ".")
137 test.unlink(['work', 'bbb.c'])
140 test.run(chdir = 'work', arguments = ".")
142 test.run(program = work_foo, stdout =
148 test.up_to_date(chdir = 'work', arguments = ".")
151 test.writable('repository', 1)
154 test.up_to_date(chdir = 'repository', arguments = ".")
161 # indent-tabs-mode:nil
163 # vim: set expandtab tabstop=4 shiftwidth=4: