summaryrefslogtreecommitdiff
path: root/test/option-n.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-10-17 16:42:21 +0000
committerSteven Knight <knight@baldmt.com>2001-10-17 16:42:21 +0000
commit772ede31d7a5aed0c72943be9230313de687e0be (patch)
treef017114c2e9f7c7b8530f6216401a07b398d4b5f /test/option-n.py
parent3b884c9421bae33e2c7a204aacc5fdc2d9394423 (diff)
downloadscons-772ede31d7a5aed0c72943be9230313de687e0be.tar.gz
Portability fixes for tests on Windows Nt.
Diffstat (limited to 'test/option-n.py')
-rw-r--r--test/option-n.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/option-n.py b/test/option-n.py
index cba2e966..0a111010 100644
--- a/test/option-n.py
+++ b/test/option-n.py
@@ -24,30 +24,32 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import TestSCons
import os.path
import string
import sys
+import TestSCons
+
+python = sys.executable
test = TestSCons.TestSCons()
test.write('build.py', r"""
import sys
-file = open(sys.argv[1], 'w')
+file = open(sys.argv[1], 'wb')
file.write("build.py: %s\n" % sys.argv[1])
file.close()
""")
test.write('SConstruct', """
MyBuild = Builder(name = "MyBuild",
- action = "python build.py $targets")
+ action = r'%s build.py $targets')
env = Environment(BUILDERS = [MyBuild])
env.MyBuild(target = 'f1.out', source = 'f1.in')
env.MyBuild(target = 'f2.out', source = 'f2.in')
-""")
+""" % python)
args = 'f1.out f2.out'
-expect = "python build.py f1.out\npython build.py f2.out\n"
+expect = "%s build.py f1.out\n%s build.py f2.out\n" % (python, python)
test.run(arguments = args, stdout = expect)
test.fail_test(not os.path.exists(test.workpath('f1.out')))