Gary Oberbrunner  committed ce26394

Fix test/sconsign/script/ test on Windows (adjusted expected result to match actual). Also made failing match_re more verbose for easier test debugging.

  • Participants
  • Parent commits cc90616
  • Branches default

Comments (0)

Files changed (2)

File QMTest/

     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))
     for i in range(len(lines)):
         s = "^" + res[i] + "$"
             msg = "Regular expression error in %s: %s"
             raise re.error(msg % (repr(s), e.args[0]))
         if not[i]):
+            print "match_re: mismatch at line %d:\n  search re='%s'\n  line='%s'"%(i,s,lines[i])
     return 1

File test/sconsign/script/

 the default dblite module and default .dblite suffix work correctly.
-import re
+import re,sys
 import TestSConsign
 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')
 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\)"""
+    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+
 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+