summaryrefslogtreecommitdiffstats
path: root/test/option--I.py
blob: eaf1440ceb19e621c73a69c3ebe681d887e355cb (plain)
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
#!/usr/bin/env python

__revision__ = "test/option--I.py __REVISION__ __DATE__ __DEVELOPER__"

import TestSCons
import string
import sys

test = TestSCons.TestSCons()

test.subdir('sub1', 'sub2')

test.write(['sub1', 'foo.py'], """
variable = "sub1/foo"
""")

test.write(['sub2', 'foo.py'], """
variable = "sub2/foo"
""")

test.write(['sub2', 'bar.py'], """
variable = "sub2/bar"
""")

test.write('SConstruct', """
import foo
print foo.variable
import bar
print bar.variable
""")

test.run(arguments = '-I sub1 -I sub2')

test.fail_test(test.stdout() != "sub1/foo\nsub2/bar\n")
test.fail_test(test.stderr() != "")

test.run(arguments = '--include-dir=sub2 --include-dir=sub1')

test.fail_test(test.stdout() != "sub2/foo\nsub2/bar\n")
test.fail_test(test.stderr() != "")

test.pass_test()