summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-11-30 22:28:19 (GMT)
committerSteven Knight <knight@baldmt.com>2002-11-30 22:28:19 (GMT)
commitbda7af53f40111daabfbcbb07e745e0afce95d2f (patch)
tree26d7804c0bfde9935dc7970a7e4d37ec5ddc0891 /test
parent454239b699f5b3b81ef3b10aa3e97361eadbf5f4 (diff)
downloadSCons-bda7af53f40111daabfbcbb07e745e0afce95d2f.zip
SCons-bda7af53f40111daabfbcbb07e745e0afce95d2f.tar.gz
SCons-bda7af53f40111daabfbcbb07e745e0afce95d2f.tar.bz2
Extend Win32 long command-line processing to lib.py. (Matt Balvin)
Diffstat (limited to 'test')
-rw-r--r--test/long-lines.py52
1 files changed, 39 insertions, 13 deletions
diff --git a/test/long-lines.py b/test/long-lines.py
index f2dc9fc..a3765ca 100644
--- a/test/long-lines.py
+++ b/test/long-lines.py
@@ -33,23 +33,37 @@ import TestSCons
test = TestSCons.TestSCons()
if sys.platform == 'win32':
- lib_=''
- _dll = '.dll'
- linkflag = '/LIBPATH:' + test.workpath()
+ lib_static_lib = 'static.lib'
+ lib_shared_dll ='shared.dll'
+ arflag_init = '/LIBPATH:' + test.workpath()
+ arflag = ' /LIBPATH:' + test.workpath()
+ linkflag_init = '/LIBPATH:' + test.workpath()
+ linkflag = ' /LIBPATH:' + test.workpath()
else:
- lib_='lib'
- _dll='.so'
- linkflag = '-L' + test.workpath()
+ lib_shared_dll = 'libshared.so'
+ lib_static_lib = 'libstatic.a'
+ arflag_init = 'r'
+ arflag = 'o'
+ linkflag_init = '-L' + test.workpath()
+ linkflag = ' -L' + test.workpath()
test.write('SConstruct', """
+arflags = r'%s'
+while len(arflags) <= 8100:
+ arflags = arflags + r'%s'
+
linkflags = r'%s'
while len(linkflags) <= 8100:
- linkflags = linkflags + r' %s'
-env = Environment(LINKFLAGS = '$LINKXXX', LINKXXX = linkflags)
+ linkflags = linkflags + r'%s'
+
+env = Environment(ARFLAGS = '$ARXXX', ARXXX = arflags,
+ LINKFLAGS = '$LINKXXX', LINKXXX = linkflags)
env.Program(target = 'foo', source = 'foo.c')
+
+env.StaticLibrary(target = 'static', source = 'static.c')
# SharedLibrary() uses $LINKFLAGS by default.
-env.SharedLibrary(target = 'bar', source = 'bar.c', no_import_lib=1)
-""" % (linkflag, linkflag))
+env.SharedLibrary(target = 'shared', source = 'shared.c', no_import_lib=1)
+""" % (arflag_init, arflag, linkflag_init, linkflag))
test.write('foo.c', r"""
int
@@ -61,12 +75,22 @@ main(int argc, char *argv[])
}
""")
-test.write('bar.c', r"""
+test.write('static.c', r"""
int
main(int argc, char *argv[])
{
argv[argc++] = "--";
- printf("foo.c\n");
+ printf("static.c\n");
+ exit (0);
+}
+""")
+
+test.write('shared.c', r"""
+int
+main(int argc, char *argv[])
+{
+ argv[argc++] = "--";
+ printf("shared.c\n");
exit (0);
}
""")
@@ -78,6 +102,8 @@ test.up_to_date(arguments = '.')
test.run(program = test.workpath('foo'), stdout = "foo.c\n")
-test.fail_test(not os.path.exists(lib_+'bar'+_dll))
+test.fail_test(not os.path.exists(lib_static_lib))
+
+test.fail_test(not os.path.exists(lib_shared_dll))
test.pass_test()