summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-09-10 23:38:55 (GMT)
committerSteven Knight <knight@baldmt.com>2001-09-10 23:38:55 (GMT)
commit41a56f7c2d2faac0b6a084e591de3faa1a3e79ff (patch)
tree7aacb222c2e89cdc423842a0a137a9df30e0f862 /test
parent5baa0ff42fc922008a0a148bef7da73b09f0dfbd (diff)
downloadSCons-41a56f7c2d2faac0b6a084e591de3faa1a3e79ff.zip
SCons-41a56f7c2d2faac0b6a084e591de3faa1a3e79ff.tar.gz
SCons-41a56f7c2d2faac0b6a084e591de3faa1a3e79ff.tar.bz2
Add -C support.
Diffstat (limited to 'test')
-rw-r--r--test/option--C.py48
1 files changed, 41 insertions, 7 deletions
diff --git a/test/option--C.py b/test/option--C.py
index db3402d..d1389bb 100644
--- a/test/option--C.py
+++ b/test/option--C.py
@@ -10,17 +10,51 @@ test = TestCmd.TestCmd(program = 'scons.py',
workdir = '',
interpreter = 'python')
-test.write('SConstruct', "")
+wpath = test.workpath()
+wpath_sub = test.workpath('sub')
+wpath_sub_dir = test.workpath('sub', 'dir')
-test.run(chdir = '.', arguments = '-C foo')
+test.subdir('sub', ['sub', 'dir'])
-test.fail_test(test.stderr() !=
- "Warning: the -C option is not yet implemented\n")
+test.write('SConstruct', """
+import os
+print "SConstruct", os.getcwd()
+""")
-test.run(chdir = '.', arguments = '--directory=foo')
+test.write(['sub', 'SConstruct'], """
+import os
+print "sub/SConstruct", os.getcwd()
+""")
-test.fail_test(test.stderr() !=
- "Warning: the --directory option is not yet implemented\n")
+test.write(['sub', 'dir', 'SConstruct'], """
+import os
+print "sub/dir/SConstruct", os.getcwd()
+""")
+
+test.run(chdir = '.', arguments = '-C sub')
+
+test.fail_test(test.stdout() != "sub/SConstruct %s\n" % wpath_sub)
+test.fail_test(test.stderr() != "")
+
+test.run(chdir = '.', arguments = '-C sub -C dir')
+
+test.fail_test(test.stdout() != "sub/dir/SConstruct %s\n" % wpath_sub_dir)
+test.fail_test(test.stderr() != "")
+
+test.run(chdir = '.')
+
+test.fail_test(test.stdout() != "SConstruct %s\n" % wpath)
+test.fail_test(test.stderr() != "")
+
+test.run(chdir = '.', arguments = '--directory=sub/dir')
+
+test.fail_test(test.stdout() != "sub/dir/SConstruct %s\n" % wpath_sub_dir)
+test.fail_test(test.stderr() != "")
+
+test.run(chdir = '.', arguments = '-C %s -C %s' % (wpath_sub_dir, wpath_sub))
+
+test.fail_test(test.stdout() != "sub/SConstruct %s\n" % wpath_sub)
+test.fail_test(test.stderr() != "")
test.pass_test()