diff options
author | Steven Knight <knight@baldmt.com> | 2001-10-12 22:20:00 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2001-10-12 22:20:00 (GMT) |
commit | 22d04cc904e082524d81e9cc243c15e9e872d28c (patch) | |
tree | a06c32b0b5caf7c0d5007a1232409f47f1e2f827 /test/LINK.py | |
parent | 2d4ea0988d82d1134cebd5bbc8a4f7a3fcbb8f2f (diff) | |
download | SCons-22d04cc904e082524d81e9cc243c15e9e872d28c.zip SCons-22d04cc904e082524d81e9cc243c15e9e872d28c.tar.gz SCons-22d04cc904e082524d81e9cc243c15e9e872d28c.tar.bz2 |
Add LINKFLAGS support.
Diffstat (limited to 'test/LINK.py')
-rw-r--r-- | test/LINK.py | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/test/LINK.py b/test/LINK.py index dec523d..f2ac661 100644 --- a/test/LINK.py +++ b/test/LINK.py @@ -24,15 +24,53 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" +import os import TestSCons test = TestSCons.TestSCons() -test.pass_test() #XXX Short-circuit until this is implemented. +test.write("ccwrapper.py", +"""import os +import string +import sys +open('%s', 'w').write("ccwrapper.py\\n") +os.system(string.join(["cc"] + sys.argv[1:], " ")) +""" % test.workpath('ccwrapper.out')) test.write('SConstruct', """ +foo = Environment() +bar = Environment(LINK = 'python ccwrapper.py') +foo.Program(target = 'foo', source = 'foo.c') +bar.Program(target = 'bar', source = 'bar.c') """) -test.run(arguments = '.') +test.write('foo.c', """ +int +main(int argc, char *argv[]) +{ + argv[argc++] = "--"; + printf("foo.c\n"); + exit (0); +} +""") + +test.write('bar.c', """ +int +main(int argc, char *argv[]) +{ + argv[argc++] = "--"; + printf("foo.c\n"); + exit (0); +} +""") + + +test.run(arguments = 'foo') + +test.fail_test(os.path.exists(test.workpath('ccwrapper.out'))) + +test.run(arguments = 'bar') + +test.fail_test(test.read('ccwrapper.out') != "ccwrapper.py\n") test.pass_test() |