diff options
author | Steven Knight <knight@baldmt.com> | 2001-11-29 06:29:22 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2001-11-29 06:29:22 (GMT) |
commit | 94888b28d673f05360670ad3eeac836b5260e44a (patch) | |
tree | 3bffd52edc3e68463a13c59d24b975ed63a19641 /test/LINKFLAGS.py | |
parent | b88f3951d7ec14f464438d4bd6af6ee95b872888 (diff) | |
download | SCons-94888b28d673f05360670ad3eeac836b5260e44a.zip SCons-94888b28d673f05360670ad3eeac836b5260e44a.tar.gz SCons-94888b28d673f05360670ad3eeac836b5260e44a.tar.bz2 |
More NT portability in the tests.
Diffstat (limited to 'test/LINKFLAGS.py')
-rw-r--r-- | test/LINKFLAGS.py | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/test/LINKFLAGS.py b/test/LINKFLAGS.py index ff4ee88..3b6e735 100644 --- a/test/LINKFLAGS.py +++ b/test/LINKFLAGS.py @@ -25,29 +25,36 @@ __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(LINK = '', LINKFLAGS = r'%s ccwrapper.py') +link = foo.Dictionary('LINK') +bar = Environment(LINK = '', LINKFLAGS = r'%s wrapper.py ' + link) foo.Program(target = 'foo', source = 'foo.c') bar.Program(target = 'bar', source = 'bar.c') """ % python) -test.write('foo.c', """ +test.write('foo.c', r""" int main(int argc, char *argv[]) { @@ -57,7 +64,7 @@ main(int argc, char *argv[]) } """) -test.write('bar.c', """ +test.write('bar.c', r""" int main(int argc, char *argv[]) { @@ -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() |