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

summaryrefslogtreecommitdiffhomepage
path: root/tools/scripts
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-02-03 20:29:36 +0100
committerMartin Hořeňovský2020-02-03 20:29:36 +0100
commit34bc56340dbb22c11d5bae8dc6018df53626281e (patch)
treee5c88e894d81712352d99bec4fd788081a8c227a /tools/scripts
parentc3a5e21648ba4cde517ed17682b1d61833c27679 (diff)
downloadcatch3-34bc56340dbb22c11d5bae8dc6018df53626281e.tar.gz
Normalize TAP approvals to avoid massive diffs for every change
Diffstat (limited to 'tools/scripts')
-rwxr-xr-xtools/scripts/approvalTests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/scripts/approvalTests.py b/tools/scripts/approvalTests.py
index bfe243ce..04463d78 100755
--- a/tools/scripts/approvalTests.py
+++ b/tools/scripts/approvalTests.py
@@ -70,6 +70,8 @@ nanParser = re.compile(r'''
__builtin_nanf\("0x<hex\ digits>"\) # The weird content of the brackets is there because a different parser has already ran before this one
''', re.VERBOSE)
+# The weird OR is there to always have at least empty string for group 1
+tapTestNumParser = re.compile(r'^(not |)?ok (\d+) -')
if len(sys.argv) == 2:
cmdPath = sys.argv[1]
@@ -125,6 +127,9 @@ def filterLine(line, isCompact):
line = line.replace(': FAILED', ': failed')
line = line.replace(': PASSED', ': passed')
+ # strip out the test order number in TAP to avoid massive diffs for every change
+ line = tapTestNumParser.sub("\g<1>ok {test-number} -", line)
+
# strip Catch version number
line = versionParser.sub("<version>", line)