aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorvladlosev <vladlosev@8415998a-534a-0410-bf83-d39667b30386>2011-09-28 18:32:59 +0000
committervladlosev <vladlosev@8415998a-534a-0410-bf83-d39667b30386>2011-09-28 18:32:59 +0000
commit0fd839682765307c49f9aa67b5c168e3d30bc356 (patch)
tree210bd9368ad31d1c528a80a019fee8a86e9e2ea6 /scripts
parent898725cf47aacd45c385bb6c537c130ac8cd224c (diff)
downloadgoogletest-0fd839682765307c49f9aa67b5c168e3d30bc356.tar.gz
googletest-0fd839682765307c49f9aa67b5c168e3d30bc356.tar.bz2
googletest-0fd839682765307c49f9aa67b5c168e3d30bc356.zip
Modifies gmock_doctor.py to work with GCC output that contains file:line:char positions and left and right quote characters (U+2018 and U+2019) instead of apostrophes (U+0027).
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gmock_doctor.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/gmock_doctor.py b/scripts/gmock_doctor.py
index ea930a38..4cfd1493 100755
--- a/scripts/gmock_doctor.py
+++ b/scripts/gmock_doctor.py
@@ -128,7 +128,7 @@ _COMMON_GMOCK_SYMBOLS = [
]
# Regex for matching source file path and line number in the compiler's errors.
-_GCC_FILE_LINE_RE = r'(?P<file>.*):(?P<line>\d+):\s+'
+_GCC_FILE_LINE_RE = r'(?P<file>.*):(?P<line>\d+):(\d+:)?\s+'
_CLANG_FILE_LINE_RE = r'(?P<file>.*):(?P<line>\d+):(?P<column>\d+):\s+'
_CLANG_NON_GMOCK_FILE_LINE_RE = (
r'(?P<file>.*[/\\^](?!gmock-)[^/\\]+):(?P<line>\d+):(?P<column>\d+):\s+')
@@ -559,6 +559,9 @@ def Diagnose(msg):
"""Generates all possible diagnoses given the compiler error message."""
msg = re.sub(r'\x1b\[[^m]*m', '', msg) # Strips all color formatting.
+ # Assuming the string is using the UTF-8 encoding, replaces the left and
+ # the right single quote characters with apostrophes.
+ msg = re.sub(r'(\xe2\x80\x98|\xe2\x80\x99)', "'", msg)
diagnoses = []
for diagnoser in _DIAGNOSERS: