summaryrefslogtreecommitdiffstats
path: root/test/LIBS.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-03-12 21:53:24 (GMT)
committerSteven Knight <knight@baldmt.com>2002-03-12 21:53:24 (GMT)
commita441c8d1cc8bf1ed0817b4b1deb9ff2e912bb9f0 (patch)
tree5ee2cd288a5dc2d36b8ac73483d460fd0107302a /test/LIBS.py
parent50ef9e4b3dbf4f1a345297d12ffe98679c50d9d1 (diff)
downloadSCons-a441c8d1cc8bf1ed0817b4b1deb9ff2e912bb9f0.zip
SCons-a441c8d1cc8bf1ed0817b4b1deb9ff2e912bb9f0.tar.gz
SCons-a441c8d1cc8bf1ed0817b4b1deb9ff2e912bb9f0.tar.bz2
Support whitespace separated CPPPATH, etc. (Task 49057). (Steve Leblanc)
Diffstat (limited to 'test/LIBS.py')
-rw-r--r--test/LIBS.py79
1 files changed, 64 insertions, 15 deletions
diff --git a/test/LIBS.py b/test/LIBS.py
index 80eadfd..6fb678a 100644
--- a/test/LIBS.py
+++ b/test/LIBS.py
@@ -34,45 +34,94 @@ else:
test = TestSCons.TestSCons()
-foo_exe = test.workpath('subdir/foo' + _exe)
+test.subdir('sub1', 'sub2')
+
+foo_exe = test.workpath('foo' + _exe)
test.write('SConstruct', """
-SConscript('subdir/SConscript')
+env = Environment(LIBS=['bar'], LIBPATH = '.')
+env.Program(target='foo', source='foo.c')
+SConscript('sub1/SConscript', 'env')
+SConscript('sub2/SConscript', 'env')
+""")
+
+test.write(['sub1', 'SConscript'], r"""
+Import('env')
+lib = env.Library(target='bar', source='bar.c baz.c')
+env.Install('..', lib)
""")
-test.subdir('subdir')
+test.write(['sub2', 'SConscript'], r"""
+Import('env')
+lib = env.Library(target='baz', source='baz.c')
+env.Install('..', lib)
+""")
-test.write('subdir/foo.c', r"""
-void do_it();
+test.write('foo.c', r"""
+void bar();
+void baz();
int main(void)
{
- do_it();
+ bar();
+ baz();
return 0;
}
""")
-test.write('subdir/bar.c', r"""
+test.write(['sub1', 'bar.c'], r"""
#include <stdio.h>
-void do_it()
+void bar()
{
- printf("bar.c\n");
+ printf("sub1/bar.c\n");
}
""")
-test.write('subdir/SConscript', r"""
-env = Environment(LIBS=['bar'], LIBPATH = [ '#subdir' ])
-env.Library(target='bar', source='bar.c')
-env.Program(target='foo', source='foo.c')
+test.write(['sub1', 'baz.c'], r"""
+#include <stdio.h>
+
+void baz()
+{
+ printf("sub1/baz.c\n");
+}
+""")
+
+test.write(['sub2', 'baz.c'], r"""
+#include <stdio.h>
+
+void baz()
+{
+ printf("sub2/baz.c\n");
+}
""")
test.run(arguments = '.')
-test.run(program=foo_exe, stdout='bar.c\n')
+test.run(program=foo_exe, stdout='sub1/bar.c\nsub1/baz.c\n')
-test.pass_test()
+#
+test.write('SConstruct', """
+env = Environment(LIBS='baz bar', LIBPATH = '.')
+env.Program(target='foo', source='foo.c')
+SConscript('sub1/SConscript', 'env')
+SConscript('sub2/SConscript', 'env')
+""")
+test.run(arguments = '.')
+test.run(program=foo_exe, stdout='sub1/bar.c\nsub2/baz.c\n')
+#
+test.write('SConstruct', """
+env = Environment(LIBS=['bar', 'baz'], LIBPATH = '.')
+env.Program(target='foo', source='foo.c')
+SConscript('sub1/SConscript', 'env')
+SConscript('sub2/SConscript', 'env')
+""")
+test.run(arguments = '.')
+
+test.run(program=foo_exe, stdout='sub1/bar.c\nsub1/baz.c\n')
+
+test.pass_test()