Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorMartin Hořeňovský2018-06-04 20:28:33 +0200
committerMartin Hořeňovský2018-06-04 23:19:55 +0200
commit2771a8ee9a5d5a25a4c52acdf026e5c16dece3c8 (patch)
tree1e29c448894635e57273ab30021f0cfc13b9d2d4 /scripts
parent7abd7db2c8f03cc2e51ea49fff5247ee5e83464b (diff)
downloadcatch3-2771a8ee9a5d5a25a4c52acdf026e5c16dece3c8.tar.gz
Normalize OS X specific pass/fail strings in approvals
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/approvalTests.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/approvalTests.py b/scripts/approvalTests.py
index 9ce927b6..3293c938 100755
--- a/scripts/approvalTests.py
+++ b/scripts/approvalTests.py
@@ -91,7 +91,7 @@ def diffFiles(fileA, fileB):
return [line for line in diff if line[0] in ('+', '-')]
-def filterLine(line):
+def filterLine(line, isCompact):
if catchPath in line:
# make paths relative to Catch root
line = line.replace(catchPath + os.sep, '')
@@ -109,6 +109,10 @@ def filterLine(line):
else:
line = lineNumberParser.sub(" ", line)
+ if isCompact:
+ line = line.replace(': FAILED', ': failed')
+ line = line.replace(': PASSED', ': passed')
+
# strip Catch version number
line = versionParser.sub("<version>", line)
@@ -148,7 +152,7 @@ def approve(baseName, args):
rawFile = io.open(rawResultsPath, 'r', encoding='utf-8', errors='surrogateescape')
filteredFile = io.open(filteredResultsPath, 'w', encoding='utf-8', errors='surrogateescape')
for line in rawFile:
- filteredFile.write(filterLine(line).rstrip() + "\n")
+ filteredFile.write(filterLine(line, 'compact' in baseName).rstrip() + "\n")
filteredFile.close()
rawFile.close()