diff options
author | Steven Knight <knight@baldmt.com> | 2001-09-21 01:30:38 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2001-09-21 01:30:38 (GMT) |
commit | c8bbea81460524f6469fa4b6afc2be5a6f338edc (patch) | |
tree | aa6a337d270384c8e12577542615ae3f3f51dc39 /test/option-i.py | |
parent | b6251d39d5f5b187a7455923caeede3b962a6d0e (diff) | |
download | SCons-c8bbea81460524f6469fa4b6afc2be5a6f338edc.zip SCons-c8bbea81460524f6469fa4b6afc2be5a6f338edc.tar.gz SCons-c8bbea81460524f6469fa4b6afc2be5a6f338edc.tar.bz2 |
Add additional tests to provide more examples.
Diffstat (limited to 'test/option-i.py')
-rw-r--r-- | test/option-i.py | 54 |
1 files changed, 47 insertions, 7 deletions
diff --git a/test/option-i.py b/test/option-i.py index c7ad495..a27f4ff 100644 --- a/test/option-i.py +++ b/test/option-i.py @@ -2,19 +2,59 @@ __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.Fail(target = 'bbb.1', source = 'bbb.in') +env.Succeed(target = 'bbb.out', source = 'bbb.1') +""") + +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.1'))) +test.fail_test(os.path.exists(test.workpath('bbb.out'))) + +test.run(arguments = '-i .') + +test.fail_test(os.path.exists(test.workpath('aaa.1'))) +test.fail_test(test.read('aaa.out') != "aaa.out\n") +test.fail_test(os.path.exists(test.workpath('bbb.1'))) +test.fail_test(test.read('bbb.out') != "bbb.out\n") + +test.unlink("aaa.out") +test.unlink("bbb.out") -test.run(arguments = '-i', - stderr = "Warning: the -i option is not yet implemented\n") +test.run(arguments = '--ignore-errors .') -test.run(arguments = '--ignore-errors', - stderr = "Warning: the --ignore-errors option is not yet implemented\n") +test.fail_test(os.path.exists(test.workpath('aaa.1'))) +test.fail_test(test.read('aaa.out') != "aaa.out\n") +test.fail_test(os.path.exists(test.workpath('bbb.1'))) +test.fail_test(test.read('bbb.out') != "bbb.out\n") test.pass_test() |