diff options
Diffstat (limited to 'test/option-k.py')
-rw-r--r-- | test/option-k.py | 49 |
1 files changed, 42 insertions, 7 deletions
diff --git a/test/option-k.py b/test/option-k.py index fb53b57..67fd113 100644 --- a/test/option-k.py +++ b/test/option-k.py @@ -2,19 +2,54 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" +import os.path import TestSCons -import string -import sys test = TestSCons.TestSCons() -test.write('SConstruct', "") +test.pass_test() #XXX Short-circuit until this is supported. + +test.write('succeed.py', r""" +import sys +file = open(sys.argv[1], 'w') +file.write("succeed.py: %s\n" % sys.argv[1]) +file.close() +sys.exit(0) +""") + +test.write('fail.py', r""" +import sys +sys.exit(1) +""") + +test.write('SConstruct', """ +Succeed = Builder(name = "Succeed", action = "python succeed.py %(target)s") +Fail = Builder(name = "Fail", action = "python fail.py %(target)s") +env = Environment(BUILDERS = [Succeed, Fail]) +env.Fail(target = 'aaa.1', source = 'aaa.in') +env.Succeed(target = 'aaa.out', source = 'aaa.1') +env.Succeed(target = 'bbb.out', source = 'bbb.in') +""") + +test.run(arguments = '.') + +test.fail_test(os.path.exists(test.workpath('aaa.1'))) +test.fail_test(os.path.exists(test.workpath('aaa.out'))) +test.fail_test(os.path.exists(test.workpath('bbb.out'))) + +test.run(arguments = '-k .') + +test.fail_test(os.path.exists(test.workpath('aaa.1'))) +test.fail_test(os.path.exists(test.workpath('aaa.out'))) +test.fail_test(test.read('bbb.out') != "bbb.out\n") + +test.unlink("bbb.out") -test.run(arguments = '-k', - stderr = "Warning: the -k option is not yet implemented\n") +test.run(arguments = '--keep-going .') -test.run(arguments = '--keep-going', - stderr = "Warning: the --keep-going option is not yet implemented\n") +test.fail_test(os.path.exists(test.workpath('aaa.1'))) +test.fail_test(os.path.exists(test.workpath('aaa.out'))) +test.fail_test(test.read('bbb.out') != "bbb.out\n") test.pass_test() |