summaryrefslogtreecommitdiffstats
path: root/test/option--.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-09-14 03:10:30 (GMT)
committerSteven Knight <knight@baldmt.com>2001-09-14 03:10:30 (GMT)
commitf4b5ccd3fdacad36cb124245591ea5bfaf4de12e (patch)
treee52ac7ce8620f4f6a4d42358f1db5354d23069e0 /test/option--.py
parent80146a665b3c939bd333b982af6b3aed2db0f426 (diff)
downloadSCons-f4b5ccd3fdacad36cb124245591ea5bfaf4de12e.zip
SCons-f4b5ccd3fdacad36cb124245591ea5bfaf4de12e.tar.gz
SCons-f4b5ccd3fdacad36cb124245591ea5bfaf4de12e.tar.bz2
Add a test for -- terminating option processing.
Diffstat (limited to 'test/option--.py')
-rw-r--r--test/option--.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/option--.py b/test/option--.py
new file mode 100644
index 0000000..41f9b0f
--- /dev/null
+++ b/test/option--.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+
+__revision__ = "test/option-n.py __REVISION__ __DATE__ __DEVELOPER__"
+
+import TestCmd
+import os.path
+import string
+import sys
+
+test = TestCmd.TestCmd(program = 'scons.py',
+ workdir = '',
+ interpreter = 'python')
+
+test.write('build.py', r"""
+import sys
+file = open(sys.argv[1], 'w')
+file.write("build.py: %s\n" % sys.argv[1])
+file.close()
+""")
+
+test.write('SConstruct', """
+MyBuild = Builder(name = "MyBuild",
+ action = "python build.py %(target)s")
+env = Environment(BUILDERS = [MyBuild])
+env.MyBuild(target = '-f1.out', source = 'f1.in')
+env.MyBuild(target = '-f2.out', source = 'f2.in')
+""")
+
+expect = "python build.py -f1.out\npython build.py -f2.out\n"
+
+test.run(chdir = '.', arguments = '-- -f1.out -f2.out')
+
+test.fail_test(test.stdout() != expect)
+test.fail_test(test.stderr() != "")
+test.fail_test(not os.path.exists(test.workpath('-f1.out')))
+test.fail_test(not os.path.exists(test.workpath('-f2.out')))
+
+test.pass_test()
+