diff options
author | Steven Knight <knight@baldmt.com> | 2001-10-11 18:38:29 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2001-10-11 18:38:29 (GMT) |
commit | 580b07ed247ab0de0ea96093fc2c4baa28c35c65 (patch) | |
tree | 400146b8838e2f89218a6ec54f27d47022c2264d /test/Library.py | |
parent | 385aabf686d687432fb81fa2e68b77e3f11f06f8 (diff) | |
download | SCons-580b07ed247ab0de0ea96093fc2c4baa28c35c65.zip SCons-580b07ed247ab0de0ea96093fc2c4baa28c35c65.tar.gz SCons-580b07ed247ab0de0ea96093fc2c4baa28c35c65.tar.bz2 |
Add the Library() method.
Diffstat (limited to 'test/Library.py')
-rw-r--r-- | test/Library.py | 15 |
1 files changed, 9 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() |