summaryrefslogtreecommitdiff
path: root/test/option-k.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-09-21 01:30:38 +0000
committerSteven Knight <knight@baldmt.com>2001-09-21 01:30:38 +0000
commitc8bbea81460524f6469fa4b6afc2be5a6f338edc (patch)
treeaa6a337d270384c8e12577542615ae3f3f51dc39 /test/option-k.py
parentb6251d39d5f5b187a7455923caeede3b962a6d0e (diff)
downloadscons-c8bbea81460524f6469fa4b6afc2be5a6f338edc.tar.gz
Add additional tests to provide more examples.
Diffstat (limited to 'test/option-k.py')
-rw-r--r--test/option-k.py49
1 files changed, 42 insertions, 7 deletions
diff --git a/test/option-k.py b/test/option-k.py
index fb53b570..67fd113b 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()