Add -I support.
[scons.git] / test / option--I.py
1 #!/usr/bin/env python
2
3 __revision__ = "test/option--I.py __REVISION__ __DATE__ __DEVELOPER__"
4
5 import TestCmd
6 import string
7 import sys
8
9 test = TestCmd.TestCmd(program = 'scons.py',
10                        workdir = '',
11                        interpreter = 'python')
12
13 test.subdir('sub1', 'sub2')
14
15 test.write(['sub1', 'foo.py'], """
16 variable = "sub1/foo"
17 """)
18
19 test.write(['sub2', 'foo.py'], """
20 variable = "sub2/foo"
21 """)
22
23 test.write(['sub2', 'bar.py'], """
24 variable = "sub2/bar"
25 """)
26
27 test.write('SConstruct', """
28 import foo
29 print foo.variable
30 import bar
31 print bar.variable
32 """)
33
34 test.run(chdir = '.', arguments = '-I sub1 -I sub2')
35
36 test.fail_test(test.stdout() != "sub1/foo\nsub2/bar\n")
37 test.fail_test(test.stderr() != "")
38
39 test.run(chdir = '.', arguments = '--include-dir=sub2 --include-dir=sub1')
40
41 test.fail_test(test.stdout() != "sub2/foo\nsub2/bar\n")
42 test.fail_test(test.stderr() != "")
43
44 test.pass_test()
45