Add a test for -- terminating option processing.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 14 Sep 2001 03:10:30 +0000 (03:10 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 14 Sep 2001 03:10:30 +0000 (03:10 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@48 fdb21ef1-2011-0410-befe-b5e4ea1792b1

test/option--.py [new file with mode: 0644]

diff --git a/test/option--.py b/test/option--.py
new file mode 100644 (file)
index 0000000..41f9b0f
--- /dev/null
@@ -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()
+