summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-10-11 18:38:29 (GMT)
committerSteven Knight <knight@baldmt.com>2001-10-11 18:38:29 (GMT)
commit580b07ed247ab0de0ea96093fc2c4baa28c35c65 (patch)
tree400146b8838e2f89218a6ec54f27d47022c2264d /test
parent385aabf686d687432fb81fa2e68b77e3f11f06f8 (diff)
downloadSCons-580b07ed247ab0de0ea96093fc2c4baa28c35c65.zip
SCons-580b07ed247ab0de0ea96093fc2c4baa28c35c65.tar.gz
SCons-580b07ed247ab0de0ea96093fc2c4baa28c35c65.tar.bz2
Add the Library() method.
Diffstat (limited to 'test')
-rw-r--r--test/Library.py15
-rw-r--r--test/Program-j.py2
2 files changed, 11 insertions, 6 deletions
diff --git a/test/Library.py b/test/Library.py
index 7a44d35..4941bbf 100644
--- a/test/Library.py
+++ b/test/Library.py
@@ -28,14 +28,16 @@ import TestSCons
test = TestSCons.TestSCons()
-test.pass_test() #XXX Short-circuit until this is implemented.
-
+#XXX Need to switch TestBld to Program() when LIBS variable is working.
test.write('SConstruct', """
-env = Environment(LIBS = 'foo1 foo2 foo3')
+TestBld = Builder(name='TestBld',
+ action='cc -o %(target)s %(source)s -L./ -lfoo1 -lfoo2 -lfoo3')
+env = Environment(BUILDERS=[ TestBld, Library ])
env.Library(target = 'foo1', source = 'f1.c')
env.Library(target = 'foo2', source = 'f2a.c f2b.c f2c.c')
env.Library(target = 'foo3', source = ['f3a.c', 'f3b.c', 'f3c.c'])
-env.Program(target = 'prog', source = 'prog.c')
+env.TestBld(target = 'prog', source = 'prog.c')
+env.Depends(target = 'prog', dependency = 'libfoo1.a libfoo2.a libfoo3.a')
""")
test.write('f1.c', """
@@ -113,12 +115,13 @@ main(int argc, char *argv[])
f3b();
f3c();
printf("prog.c\n");
+ return 0;
}
""")
-test.run(arguments = 'libfoo1.a libfoo2.a libfoo3.a')
+test.run(arguments = 'libfoo1.a libfoo2.a libfoo3.a prog')
test.run(program = test.workpath('prog'),
- stdout = "f1.c\nf2a.c\nf2b.c\nf2c.c\nf3a.c\nf3b.c\nf3c.c\nprog.c\n")
+ stdout = "f1.c\nf2a.c\nf2b.c\nf2c.c\nf3a.c\nf3b.c\nf3c.c\nprog.c\n")
test.pass_test()
diff --git a/test/Program-j.py b/test/Program-j.py
index 6b86127..95088a6 100644
--- a/test/Program-j.py
+++ b/test/Program-j.py
@@ -28,6 +28,8 @@ import TestSCons
test = TestSCons.TestSCons()
+test.pass_test() #XXX Short-circuit until this is supported.
+
test.write('SConstruct', """
env = Environment()
env.Program(target = 'f1', source = 'f1.c')