summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2011-05-15 15:17:57 (GMT)
committerGary Oberbrunner <garyo@oberbrunner.com>2011-05-15 15:17:57 (GMT)
commitbe4d85f186c0a3155d1f90b886ca720ee7efe43e (patch)
treef1c1a38300b862596d79051a1ffc39786f7cd02d
parentb104e3be7f6a4b5c0716e58086460dd3941151f1 (diff)
downloadSCons-be4d85f186c0a3155d1f90b886ca720ee7efe43e.zip
SCons-be4d85f186c0a3155d1f90b886ca720ee7efe43e.tar.gz
SCons-be4d85f186c0a3155d1f90b886ca720ee7efe43e.tar.bz2
Fix test/sconsign/script/dblite.py test on Windows (adjusted expected result to match actual). Also made failing match_re more verbose for easier test debugging.
-rw-r--r--QMTest/TestCmd.py2
-rw-r--r--test/sconsign/script/dblite.py22
2 files changed, 19 insertions, 5 deletions
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py
index a67e92f..1d5e4d0 100644
--- a/QMTest/TestCmd.py
+++ b/QMTest/TestCmd.py
@@ -474,6 +474,7 @@ def match_re(lines = None, res = None):
if not is_List(res):
res = res.split("\n")
if len(lines) != len(res):
+ print "match_re: expected %d lines, found %d"%(len(res), len(lines))
return
for i in range(len(lines)):
s = "^" + res[i] + "$"
@@ -483,6 +484,7 @@ def match_re(lines = None, res = None):
msg = "Regular expression error in %s: %s"
raise re.error(msg % (repr(s), e.args[0]))
if not expr.search(lines[i]):
+ print "match_re: mismatch at line %d:\n search re='%s'\n line='%s'"%(i,s,lines[i])
return
return 1
diff --git a/test/sconsign/script/dblite.py b/test/sconsign/script/dblite.py
index 2a53b2e..1359dd5 100644
--- a/test/sconsign/script/dblite.py
+++ b/test/sconsign/script/dblite.py
@@ -29,7 +29,7 @@ Verify that various ways of getting at a an sconsign file written with
the default dblite module and default .dblite suffix work correctly.
"""
-import re
+import re,sys
import TestSConsign
@@ -39,8 +39,14 @@ CC = test.detect('CC', norm=1)
LINK = test.detect('LINK', norm=1)
if LINK is None: LINK = CC
-CC = re.escape(CC)
-LINK = re.escape(LINK)
+def escape_drive_case(s):
+ """Turn c\: into [cC]\:"""
+ if re.match(r'^(.)[\\]?:', s):
+ drive=s[0]
+ return '['+drive.lower()+drive.upper()+']'+s[1:]
+
+CC = escape_drive_case(re.escape(CC))
+LINK = escape_drive_case(re.escape(LINK))
test.subdir('sub1', 'sub2')
@@ -101,11 +107,17 @@ test.run(arguments = '. --max-drift=1')
sig_re = r'[0-9a-fA-F]{32}'
date_re = r'\S+ \S+ [ \d]\d \d\d:\d\d:\d\d \d\d\d\d'
+if sys.platform == 'win32':
+ manifest = r"""
+embedManifestExeCheck\(target, source, env\)"""
+else:
+ manifest = ''
+
expect = r"""=== sub1:
hello.exe: %(sig_re)s \d+ \d+
%(sub1_hello_obj)s: %(sig_re)s \d+ \d+
%(LINK)s: None \d+ \d+
- %(sig_re)s \[.*\]
+ %(sig_re)s \[.*%(manifest)s\]
hello.obj: %(sig_re)s \d+ \d+
%(sub1_hello_c)s: None \d+ \d+
%(CC)s: None \d+ \d+
@@ -116,7 +128,7 @@ expect_r = """=== sub1:
hello.exe: %(sig_re)s '%(date_re)s' \d+
%(sub1_hello_obj)s: %(sig_re)s '%(date_re)s' \d+
%(LINK)s: None '%(date_re)s' \d+
- %(sig_re)s \[.*\]
+ %(sig_re)s \[.*%(manifest)s\]
hello.obj: %(sig_re)s '%(date_re)s' \d+
%(sub1_hello_c)s: None '%(date_re)s' \d+
%(CC)s: None '%(date_re)s' \d+