diff options
author | Steven Knight <knight@baldmt.com> | 2004-09-15 01:19:55 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-09-15 01:19:55 (GMT) |
commit | 7fef06f597626b9ee3faa0aa716819258e583812 (patch) | |
tree | c43c6b210684e12eb7c33ddc82ef5325be21feb4 /test/build-errors.py | |
parent | decb5aded9c3103e52a31cd75fed2391e7bf29c5 (diff) | |
download | SCons-7fef06f597626b9ee3faa0aa716819258e583812.zip SCons-7fef06f597626b9ee3faa0aa716819258e583812.tar.gz SCons-7fef06f597626b9ee3faa0aa716819258e583812.tar.bz2 |
Handle exceptions in FunctionActions. (Steve Christensen)
Diffstat (limited to 'test/build-errors.py')
-rw-r--r-- | test/build-errors.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/build-errors.py b/test/build-errors.py index 1ea2d7a..f64786f 100644 --- a/test/build-errors.py +++ b/test/build-errors.py @@ -187,4 +187,37 @@ else: break test.fail_test(error_message_not_found) +test.write('SConstruct4', r""" +env = Environment() +env.Command('test.out', 'test.in', 'cp $SOURCE $TARGET') +env.InstallAs('test2.out', 'test.out') +# Mark test2.out as precious so we'll handle the exception in +# FunctionAction() rather than when the target is cleaned before building. +env.Precious('test2.out') +env.Default('test2.out') +""") + +test.write('test.in', "test.in 1\n") + +test.run(arguments = '-f SConstruct4 .') + +test.write('test.in', "test.in 2\n") + +test.writable('test2.out', 0) +f = open(test.workpath('test2.out')) + +test.run(arguments = '-f SConstruct4 .', + stderr = None, + status = 2) + +f.close() +test.writable('test2.out', 1) + +test.description_set("Incorrect STDERR:\n%s" % test.stderr()) +errs = [ + "scons: *** [test2.out] Permission denied\n", + "scons: *** [test2.out] permission denied\n", +] +test.fail_test(test.stderr() not in errs) + test.pass_test() |