diff options
author | Steven Knight <knight@baldmt.com> | 2001-09-21 01:30:38 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2001-09-21 01:30:38 (GMT) |
commit | c8bbea81460524f6469fa4b6afc2be5a6f338edc (patch) | |
tree | aa6a337d270384c8e12577542615ae3f3f51dc39 /test/CCFLAGS.py | |
parent | b6251d39d5f5b187a7455923caeede3b962a6d0e (diff) | |
download | SCons-c8bbea81460524f6469fa4b6afc2be5a6f338edc.zip SCons-c8bbea81460524f6469fa4b6afc2be5a6f338edc.tar.gz SCons-c8bbea81460524f6469fa4b6afc2be5a6f338edc.tar.bz2 |
Add additional tests to provide more examples.
Diffstat (limited to 'test/CCFLAGS.py')
-rw-r--r-- | test/CCFLAGS.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/CCFLAGS.py b/test/CCFLAGS.py new file mode 100644 index 0000000..356fc84 --- /dev/null +++ b/test/CCFLAGS.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python + +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" + +import TestSCons + +test = TestSCons.TestSCons() + +test.pass_test() #XXX Short-circuit until this is implemented. + +test.write('SConstruct', """ +foo = Environment(CCFLAGS = '-DFOO') +bar = Environment(CCFLAGS = '-DBAR') +foo.Program(target = 'progfoo', source = 'prog.c') +bar.Program(target = 'progbar', source = 'prog.c') +""") + +test.write('prog.c', """ +int +main(int argc, char *argv[]) +{ + argv[argc++] = "--"; +#ifdef FOO + printf("prog.c: FOO\n"); +#endif +#ifdef BAR + printf("prog.c: BAR\n"); +#endif + exit (0); +} +""") + + +test.run(arguments = 'progfoo progbar') + +test.run(program = test.workpath('progfoo'), stdout = "prog.c: FOO\n") +test.run(program = test.workpath('progbar'), stdout = "prog.c: BAR\n") + +test.pass_test() |