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

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

import TestCmd
import os.path

test = TestCmd.TestCmd(program = 'scons.py',
                       workdir = '',
                       interpreter = 'python')

test.subdir('subdir')

subdir_BuildThis = os.path.join('subdir', 'Buildthis')

test.write('SConscript', """
import os
print "SConscript " + os.getcwd()
""")

test.write(subdir_BuildThis, """
import os
print "subdir/BuildThis", os.getcwd()
""")

wpath = test.workpath()

test.run(chdir = '.', arguments = '-f SConscript')
test.fail_test(test.stdout() != ("SConscript %s\n" % wpath))

test.run(chdir = '.', arguments = '-f ' + subdir_BuildThis)
test.fail_test(test.stdout() != ("subdir/BuildThis %s\n" % wpath))

test.pass_test()