diff options
author | Steven Knight <knight@baldmt.com> | 2002-04-11 19:13:45 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-04-11 19:13:45 (GMT) |
commit | 651aa3558b6192f7eb3f77c8f2102c1e0e824707 (patch) | |
tree | 2804c3ec78c1d48080fe83dbe3d766c63a2926fa /test | |
parent | 0bf9bbc298b57b985bb84f8c60bbc70eca71bbaa (diff) | |
download | SCons-651aa3558b6192f7eb3f77c8f2102c1e0e824707.zip SCons-651aa3558b6192f7eb3f77c8f2102c1e0e824707.tar.gz SCons-651aa3558b6192f7eb3f77c8f2102c1e0e824707.tar.bz2 |
Make .sconsign files get written even if the build fails or is terminated. (Anthony Roach)
Diffstat (limited to 'test')
-rw-r--r-- | test/errors.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/errors.py b/test/errors.py index 1f582f7..9f1a83c 100644 --- a/test/errors.py +++ b/test/errors.py @@ -26,9 +26,49 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestCmd import TestSCons +import string test = TestSCons.TestSCons(match = TestCmd.match_re) +test.write('foo.in', 'foo') +test.write('exit.in', 'exit') +test.write('SConstruct', """ +import sys + +def foo(env, target, source): + print str(target[0]) + open(str(target[0]), 'wt').write('foo') + +def exit(env, target, source): + raise 'exit' + +env = Environment(BUILDERS = [Builder(name='foo', action=foo), + Builder(name='exit', action=exit)]) + +env.foo('foo.out', 'foo.in') +env.exit('exit.out', 'exit.in') +""") + +stderr = """scons: \*\*\* \[exit.out\] Exception +Traceback \((most recent call|innermost) last\): + File ".+", line \d+, in .+ + .+ + File ".+", line \d+, in .+ + .+ + File ".+", line \d+, in .+ + .+ + File ".+", line \d+, in .+ + .+ +.+ +""" + +test.run(arguments='foo.out exit.out', stderr=stderr, status=2) + +test.run(arguments='foo.out exit.out', stderr=stderr, status=2) +assert string.find(test.stdout(), 'scons: "foo.out" is up to date.') != -1, test.stdout() + + + test.write('SConstruct1', """ a ! x """) |