summaryrefslogtreecommitdiffstats
path: root/test/diskcheck.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-06-10 11:59:43 (GMT)
committerSteven Knight <knight@baldmt.com>2005-06-10 11:59:43 (GMT)
commit0462645d5027fcf4286775d88d2f6fb52abad3b1 (patch)
treecc587623d5579d9c08eddfeaa1edd9efd697ec3e /test/diskcheck.py
parentae6191eaaba20e630d4ea34d701bf14ebedee303 (diff)
downloadSCons-0462645d5027fcf4286775d88d2f6fb52abad3b1.zip
SCons-0462645d5027fcf4286775d88d2f6fb52abad3b1.tar.gz
SCons-0462645d5027fcf4286775d88d2f6fb52abad3b1.tar.bz2
Add a --diskcheck option to control looking on-disk for things.
Diffstat (limited to 'test/diskcheck.py')
-rw-r--r--test/diskcheck.py81
1 files changed, 81 insertions, 0 deletions
diff --git a/test/diskcheck.py b/test/diskcheck.py
new file mode 100644
index 0000000..b8ef2fe
--- /dev/null
+++ b/test/diskcheck.py
@@ -0,0 +1,81 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test that the --diskcheck option and SetOption('diskcheck') correctly
+control where or not we look for on-disk matches files and directories
+that we look up.
+"""
+
+import string
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+test.subdir('subdir')
+
+test.write('file', "file\n")
+
+
+
+test.write('SConstruct', """
+SetOption('diskcheck', 'none')
+File('subdir')
+""")
+
+test.run()
+
+test.run(arguments='--diskcheck=match', status=2, stderr=None)
+test.fail_test(string.find(test.stderr(), "found where file expected") == -1)
+
+
+
+test.write('SConstruct', """
+SetOption('diskcheck', ['rcs', 'sccs'])
+Dir('file')
+""")
+
+test.run()
+
+test.run(arguments='--diskcheck=match', status=2, stderr=None)
+test.fail_test(string.find(test.stderr(), "found where directory expected") == -1)
+
+
+
+test.write('SConstruct', """
+SetOption('diskcheck', 'rcs,sccs')
+Dir('file/subdir')
+""")
+
+test.run()
+
+test.run(arguments='--diskcheck=match', status=2, stderr=None)
+test.fail_test(string.find(test.stderr(), "found where directory expected") == -1)
+
+
+
+test.pass_test()