1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#!/usr/bin/env python
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
import string
import sys
test = TestSCons.TestSCons()
wpath = test.workpath()
wpath_sub = test.workpath('sub')
wpath_sub_dir = test.workpath('sub', 'dir')
test.subdir('sub', ['sub', 'dir'])
test.write('SConstruct', """
import os
print "SConstruct", os.getcwd()
""")
test.write(['sub', 'SConstruct'], """
import os
print "sub/SConstruct", os.getcwd()
""")
test.write(['sub', 'dir', 'SConstruct'], """
import os
print "sub/dir/SConstruct", os.getcwd()
""")
test.run(arguments = '-C sub',
stdout = "sub/SConstruct %s\n" % wpath_sub)
test.run(arguments = '-C sub -C dir',
stdout = "sub/dir/SConstruct %s\n" % wpath_sub_dir)
test.run(stdout = "SConstruct %s\n" % wpath)
test.run(arguments = '--directory=sub/dir',
stdout = "sub/dir/SConstruct %s\n" % wpath_sub_dir)
test.run(arguments = '-C %s -C %s' % (wpath_sub_dir, wpath_sub),
stdout = "sub/SConstruct %s\n" % wpath_sub)
test.pass_test()
|