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 | dd5fc77179a00c9034896cd869d6885d4d266c5e (patch) | |
tree | c43c6b210684e12eb7c33ddc82ef5325be21feb4 /test/build-errors.py | |
parent | 467ed8043f59e6ea307bebb855fa9d7b065f465e (diff) | |
download | SCons-dd5fc77179a00c9034896cd869d6885d4d266c5e.zip SCons-dd5fc77179a00c9034896cd869d6885d4d266c5e.tar.gz SCons-dd5fc77179a00c9034896cd869d6885d4d266c5e.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() |