summaryrefslogtreecommitdiff
path: root/test/option--random.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-02-06 04:59:18 +0000
committerSteven Knight <knight@baldmt.com>2003-02-06 04:59:18 +0000
commitc07047f3cfdb2eb3c7f29a96afb2accdfed69184 (patch)
tree30f7a8eaaf3a53ed7e7ec2f571db675a3cfa6873 /test/option--random.py
parent1321ef0af677827deb274d698d06ffa8b73010b0 (diff)
downloadscons-c07047f3cfdb2eb3c7f29a96afb2accdfed69184.tar.gz
Add the --random option.
Diffstat (limited to 'test/option--random.py')
-rw-r--r--test/option--random.py48
1 files changed, 42 insertions, 6 deletions
diff --git a/test/option--random.py b/test/option--random.py
index 205a8036..f806bbee 100644
--- a/test/option--random.py
+++ b/test/option--random.py
@@ -24,16 +24,52 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""
+Verify that we build correctly using the --random option.
+"""
+
+import os.path
+
import TestSCons
-import string
-import sys
test = TestSCons.TestSCons()
-test.write('SConstruct', "")
+test.write('SConstruct', """
+def cat(env, source, target):
+ target = str(target[0])
+ source = map(str, source)
+ f = open(target, "wb")
+ for src in source:
+ f.write(open(src, "rb").read())
+ f.close()
+env = Environment(BUILDERS={'Cat':Builder(action=cat)})
+env.Cat('aaa.out', 'aaa.in')
+env.Cat('bbb.out', 'bbb.in')
+env.Cat('ccc.out', 'ccc.in')
+env.Cat('all', ['aaa.out', 'bbb.out', 'ccc.out'])
+""")
+
+test.write('aaa.in', "aaa.in\n")
+test.write('bbb.in', "bbb.in\n")
+test.write('ccc.in', "ccc.in\n")
+
+test.run(arguments = '--random .')
+
+test.fail_test(test.read('all') != "aaa.in\nbbb.in\nccc.in\n")
+
+test.run(arguments = '-q --random .')
+
+test.run(arguments = '-c --random .')
+
+test.fail_test(os.path.exists(test.workpath('aaa.out')))
+test.fail_test(os.path.exists(test.workpath('bbb.out')))
+test.fail_test(os.path.exists(test.workpath('ccc.out')))
+test.fail_test(os.path.exists(test.workpath('all')))
+
+test.run(arguments = '-q --random .', status = 1)
+
+test.run(arguments = '--random .')
-test.run(arguments = '--random .',
- stderr = "Warning: the --random option is not yet implemented\n")
+test.fail_test(test.read('all') != "aaa.in\nbbb.in\nccc.in\n")
test.pass_test()
-