diff options
author | Steven Knight <knight@baldmt.com> | 2004-04-04 04:01:53 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-04-04 04:01:53 (GMT) |
commit | 30f01a9a0339978e15115cd2ad8fd169d88e1ab1 (patch) | |
tree | 09d153a86945df53d71c32d53e865c6e2fd3c1b4 /test/emitter.py | |
parent | e3395e16f968f033c77090aa8b4212c0f89ebf6a (diff) | |
download | SCons-30f01a9a0339978e15115cd2ad8fd169d88e1ab1.zip SCons-30f01a9a0339978e15115cd2ad8fd169d88e1ab1.tar.gz SCons-30f01a9a0339978e15115cd2ad8fd169d88e1ab1.tar.bz2 |
Allow a list of emitters to be called in sequence. (Chad Austin)
Diffstat (limited to 'test/emitter.py')
-rw-r--r-- | test/emitter.py | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/test/emitter.py b/test/emitter.py index 70d4c8f..0bdc619 100644 --- a/test/emitter.py +++ b/test/emitter.py @@ -49,30 +49,47 @@ def emitter(target, source, env): target.append(str(target[0])+".foo") return target,source -b = Builder(action=build, emitter=emitter) +def emit1(t, s, e): return (t + ['emit.1'], s) +def emit2(t, s, e): return (t + ['emit.2'], s) -env=Environment(BUILDERS={ 'foo': b }) +foo = Builder(action=build, emitter=emitter) +bar = Builder(action=build, emitter='$EMITTERS') + +env=Environment(BUILDERS={ 'foo': foo, 'bar': bar }, + EMITTERS=[emit1, emit2]) env.foo('f.out', 'f.in') env.foo(File('g.out'), 'g.in') +env.bar('h.out', 'h.in') """) test.write(['src', 'f.in'], 'f.in') test.write(['src', 'g.in'], 'g.in') +test.write(['src', 'h.in'], 'h.in') test.run(arguments='.') -test.fail_test(not os.path.exists(test.workpath('src', 'f.out'))) -test.fail_test(not os.path.exists(test.workpath('src', 'f.out.foo'))) -test.fail_test(not os.path.exists(test.workpath('var1', 'f.out'))) -test.fail_test(not os.path.exists(test.workpath('var1', 'f.out.foo'))) -test.fail_test(not os.path.exists(test.workpath('var2', 'f.out'))) -test.fail_test(not os.path.exists(test.workpath('var2', 'f.out.foo'))) - -test.fail_test(not os.path.exists(test.workpath('src', 'g.out'))) -test.fail_test(not os.path.exists(test.workpath('src', 'g.out.foo'))) -test.fail_test(not os.path.exists(test.workpath('var1', 'g.out'))) -test.fail_test(not os.path.exists(test.workpath('var1', 'g.out.foo'))) -test.fail_test(not os.path.exists(test.workpath('var2', 'g.out'))) -test.fail_test(not os.path.exists(test.workpath('var2', 'g.out.foo'))) +test.must_exist(test.workpath('src', 'f.out')) +test.must_exist(test.workpath('src', 'f.out.foo')) +test.must_exist(test.workpath('var1', 'f.out')) +test.must_exist(test.workpath('var1', 'f.out.foo')) +test.must_exist(test.workpath('var2', 'f.out')) +test.must_exist(test.workpath('var2', 'f.out.foo')) + +test.must_exist(test.workpath('src', 'g.out')) +test.must_exist(test.workpath('src', 'g.out.foo')) +test.must_exist(test.workpath('var1', 'g.out')) +test.must_exist(test.workpath('var1', 'g.out.foo')) +test.must_exist(test.workpath('var2', 'g.out')) +test.must_exist(test.workpath('var2', 'g.out.foo')) + +test.must_exist(test.workpath('src', 'h.out')) +test.must_exist(test.workpath('src', 'emit.1')) +test.must_exist(test.workpath('src', 'emit.2')) +test.must_exist(test.workpath('var1', 'h.out')) +test.must_exist(test.workpath('var1', 'emit.1')) +test.must_exist(test.workpath('var1', 'emit.2')) +test.must_exist(test.workpath('var2', 'h.out')) +test.must_exist(test.workpath('var2', 'emit.1')) +test.must_exist(test.workpath('var2', 'emit.2')) test.pass_test() |