diff options
author | Steven Knight <knight@baldmt.com> | 2002-04-16 10:24:10 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-04-16 10:24:10 (GMT) |
commit | 0331e6f13472a35aedb7e61db4ab8219e464bed2 (patch) | |
tree | e192d252429dd89fcbd368fe2be9b8554f27790b /test/long-lines.py | |
parent | bbdad76b308f2bc3a38da616ab8333e469c558c6 (diff) | |
download | SCons-0331e6f13472a35aedb7e61db4ab8219e464bed2.zip SCons-0331e6f13472a35aedb7e61db4ab8219e464bed2.tar.gz SCons-0331e6f13472a35aedb7e61db4ab8219e464bed2.tar.bz2 |
Handle long command lines for the MSVC linker.
Diffstat (limited to 'test/long-lines.py')
-rw-r--r-- | test/long-lines.py | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/test/long-lines.py b/test/long-lines.py new file mode 100644 index 0000000..6df229c --- /dev/null +++ b/test/long-lines.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001, 2002 Steven Knight +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" + +import os +import string +import sys +import TestSCons + +test = TestSCons.TestSCons() + +if sys.platform == 'win32': + linkflag = '/LIBPATH:' + test.workpath() +else: + linkflag = '-L' + test.workpath() + +test.write('SConstruct', """ +linkflags = r'%s' +while len(linkflags) <= 8100: + linkflags = linkflags + r' %s' +env = Environment(LINKFLAGS = linkflags) +env.Program(target = 'foo', source = 'foo.c') +""" % (linkflag, linkflag)) + +test.write('foo.c', r""" +int +main(int argc, char *argv[]) +{ + argv[argc++] = "--"; + printf("foo.c\n"); + exit (0); +} +""") + +test.run(arguments = '.') + +test.run(program = test.workpath('foo'), stdout = "foo.c\n") + +test.pass_test() |