summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-10-21 21:47:31 (GMT)
committerSteven Knight <knight@baldmt.com>2004-10-21 21:47:31 (GMT)
commiteed44d1a631844c0bdaf524078a0bed587b7c965 (patch)
treee42b3037c2924296e50d3b3d4095097faa5c0094 /etc
parentfaab5238bb1eb72127736c1b997f6b0f11da6a5d (diff)
downloadSCons-eed44d1a631844c0bdaf524078a0bed587b7c965.zip
SCons-eed44d1a631844c0bdaf524078a0bed587b7c965.tar.gz
SCons-eed44d1a631844c0bdaf524078a0bed587b7c965.tar.bz2
Win32 portability fixes for tests.
Diffstat (limited to 'etc')
-rw-r--r--etc/TestCmd.py4
-rw-r--r--etc/TestCommon.py12
2 files changed, 8 insertions, 8 deletions
diff --git a/etc/TestCmd.py b/etc/TestCmd.py
index cc73dd1..b90e653 100644
--- a/etc/TestCmd.py
+++ b/etc/TestCmd.py
@@ -175,8 +175,8 @@ version.
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
__author__ = "Steven Knight <knight at baldmt dot com>"
-__revision__ = "TestCmd.py 0.11.D001 2004/09/13 13:22:19 knight"
-__version__ = "0.11"
+__revision__ = "TestCmd.py 0.12.D001 2004/10/21 14:00:53 knight"
+__version__ = "0.12"
import os
import os.path
diff --git a/etc/TestCommon.py b/etc/TestCommon.py
index 924f8f8..8ef9b3d 100644
--- a/etc/TestCommon.py
+++ b/etc/TestCommon.py
@@ -76,8 +76,8 @@ The TestCommon module also provides the following variables
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
__author__ = "Steven Knight <knight at baldmt dot com>"
-__revision__ = "TestCommon.py 0.11.D001 2004/09/13 13:22:19 knight"
-__version__ = "0.11"
+__revision__ = "TestCommon.py 0.12.D001 2004/10/21 14:00:53 knight"
+__version__ = "0.12"
import os
import os.path
@@ -193,10 +193,10 @@ class TestCommon(TestCmd):
apply(TestCmd.__init__, [self], kw)
os.chdir(self.workdir)
- def must_contain(self, file, required):
+ def must_contain(self, file, required, mode = 'rb'):
"""Ensures that the specified file contains the required text.
"""
- file_contents = self.read(file)
+ file_contents = self.read(file, mode)
contains = (string.find(file_contents, required) != -1)
if not contains:
print "File `%s' does not contain required string." % file
@@ -218,13 +218,13 @@ class TestCommon(TestCmd):
print "Missing files: `%s'" % string.join(missing, "', `")
self.fail_test(missing)
- def must_match(self, file, expect):
+ def must_match(self, file, expect, mode = 'rb'):
"""Matches the contents of the specified file (first argument)
against the expected contents (second argument). The expected
contents are a list of lines or a string which will be split
on newlines.
"""
- file_contents = self.read(file)
+ file_contents = self.read(file, mode)
try:
self.fail_test(not self.match(file_contents, expect))
except: