summaryrefslogtreecommitdiff
path: root/test/Command.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/Command.py
parent3b884c9421bae33e2c7a204aacc5fdc2d9394423 (diff)
downloadscons-772ede31d7a5aed0c72943be9230313de687e0be.tar.gz
Portability fixes for tests on Windows Nt.
Diffstat (limited to 'test/Command.py')
-rw-r--r--test/Command.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/test/Command.py b/test/Command.py
index 5b592b97..c3080cbc 100644
--- a/test/Command.py
+++ b/test/Command.py
@@ -24,14 +24,17 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+import sys
import TestSCons
+python = sys.executable
+
test = TestSCons.TestSCons()
test.write('build.py', r"""
import sys
-contents = open(sys.argv[2], 'r').read()
-file = open(sys.argv[1], 'w')
+contents = open(sys.argv[2], 'rb').read()
+file = open(sys.argv[1], 'wb')
file.write(contents)
file.close()
""")
@@ -39,14 +42,14 @@ file.close()
test.write('SConstruct', """
env = Environment()
env.Command(target = 'f1.out', source = 'f1.in',
- action = "python build.py $target $sources")
+ action = r'%s build.py $target $sources')
env.Command(target = 'f2.out', source = 'f2.in',
- action = "python build.py temp2 $sources\\npython build.py $target temp2")
+ action = r'%s' + " build.py temp2 $sources\\n" + r'%s' + " build.py $target temp2")
env.Command(target = 'f3.out', source = 'f3.in',
- action = ["python build.py temp3 $sources",
- "python build.py $target temp3"])
+ action = [r'%s build.py temp3 $sources',
+ r'%s build.py $target temp3'])
# Eventually, add ability to do execute Python code.
-""")
+""" % (python, python, python, python, python))
test.write('f1.in', "f1.in\n")