diff options
author | Steven Knight <knight@baldmt.com> | 2004-03-16 00:56:26 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-03-16 00:56:26 (GMT) |
commit | 215d8f4f216c25b49188bfd5b385b03d0a4b3f38 (patch) | |
tree | 5d86726ecf4cfa6fe5271af455da50fd26e7e542 /test/Command.py | |
parent | 7f0857e23182eb4fba10dc65216c65dbe7ee13da (diff) | |
download | SCons-215d8f4f216c25b49188bfd5b385b03d0a4b3f38.zip SCons-215d8f4f216c25b49188bfd5b385b03d0a4b3f38.tar.gz SCons-215d8f4f216c25b49188bfd5b385b03d0a4b3f38.tar.bz2 |
Support passing arbitrary environment override keywords to Command().
Diffstat (limited to 'test/Command.py')
-rw-r--r-- | test/Command.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Command.py b/test/Command.py index ff81f66..49a6ae3 100644 --- a/test/Command.py +++ b/test/Command.py @@ -47,6 +47,9 @@ import os def buildIt(env, target, source): contents = open(str(source[0]), 'rb').read() file = open(str(target[0]), 'wb') + xyzzy = env.get('XYZZY', '') + if xyzzy: + file.write(xyzzy + '\\n') file.write(contents) file.close() return 0 @@ -72,6 +75,8 @@ env.Command(target = 'f3.out', source = 'f3.in', action = [ [ r'%s', 'build.py', 'temp3', '$SOURCES' ], [ r'%s', 'build.py', '$TARGET', 'temp3'] ]) Command(target = 'f4.out', source = 'sub', action = sub) +env.Command(target = 'f5.out', source = 'f5.in', action = buildIt, + XYZZY="XYZZY is set") """ % (python, python, python, python)) test.write('f1.in', "f1.in\n") @@ -80,6 +85,7 @@ test.write('f3.in', "f3.in\n") test.write(['sub', 'f4a'], "sub/f4a\n") test.write(['sub', 'f4b'], "sub/f4b\n") test.write(['sub', 'f4c'], "sub/f4c\n") +test.write('f5.in', "f5.in\n") test.run(arguments = '.') @@ -87,5 +93,6 @@ test.fail_test(test.read('f1.out') != "f1.in\n") test.fail_test(test.read('f2.out') != "f2.in\n") test.fail_test(test.read('f3.out') != "f3.in\n") test.fail_test(test.read('f4.out') != "sub/f4a\nsub/f4b\nsub/f4c\n") +test.fail_test(test.read('f5.out') != "XYZZY is set\nf5.in\n") test.pass_test() |