summaryrefslogtreecommitdiffstats
path: root/test/CC.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-11-29 06:29:22 (GMT)
committerSteven Knight <knight@baldmt.com>2001-11-29 06:29:22 (GMT)
commit94888b28d673f05360670ad3eeac836b5260e44a (patch)
tree3bffd52edc3e68463a13c59d24b975ed63a19641 /test/CC.py
parentb88f3951d7ec14f464438d4bd6af6ee95b872888 (diff)
downloadSCons-94888b28d673f05360670ad3eeac836b5260e44a.zip
SCons-94888b28d673f05360670ad3eeac836b5260e44a.tar.gz
SCons-94888b28d673f05360670ad3eeac836b5260e44a.tar.bz2
More NT portability in the tests.
Diffstat (limited to 'test/CC.py')
-rw-r--r--test/CC.py25
1 files changed, 16 insertions, 9 deletions
diff --git a/test/CC.py b/test/CC.py
index 70e6da5..395b1ba 100644
--- a/test/CC.py
+++ b/test/CC.py
@@ -25,24 +25,31 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
+import string
import sys
import TestSCons
python = sys.executable
+if sys.platform == 'win32':
+ _exe = '.exe'
+else:
+ _exe = ''
+
test = TestSCons.TestSCons()
-test.write("ccwrapper.py",
+test.write("wrapper.py",
"""import os
import string
import sys
-open('%s', 'wb').write("ccwrapper.py\\n")
-os.system(string.join(["cc"] + sys.argv[1:], " "))
-""" % test.workpath('ccwrapper.out'))
+open('%s', 'wb').write("wrapper.py\\n")
+os.system(string.join(sys.argv[1:], " "))
+""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\'))
test.write('SConstruct', """
foo = Environment()
-bar = Environment(CC = r'%s ccwrapper.py')
+cc = foo.Dictionary('CC')
+bar = Environment(CC = r'%s wrapper.py ' + cc)
foo.Program(target = 'foo', source = 'foo.c')
bar.Program(target = 'bar', source = 'bar.c')
""" % python)
@@ -68,12 +75,12 @@ main(int argc, char *argv[])
""")
-test.run(arguments = 'foo')
+test.run(arguments = 'foo' + _exe)
-test.fail_test(os.path.exists(test.workpath('ccwrapper.out')))
+test.fail_test(os.path.exists(test.workpath('wrapper.out')))
-test.run(arguments = 'bar')
+test.run(arguments = 'bar' + _exe)
-test.fail_test(test.read('ccwrapper.out') != "ccwrapper.py\n")
+test.fail_test(test.read('wrapper.out') != "wrapper.py\n")
test.pass_test()