Gary Oberbrunner avatar Gary Oberbrunner committed ce26394

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.

Comments (0)

Files changed (2)

QMTest/TestCmd.py

     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] + "$"
             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
 

test/sconsign/script/dblite.py

 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\)"""
+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+
 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+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.