diff options
| author | Martin Hořeňovský | 2022-01-26 23:47:40 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2022-01-27 21:11:51 +0100 |
| commit | 4ff8b27bb6bed4b8b309e56cd269b4f1fbc24e89 (patch) | |
| tree | f4186911b20161e359d788bd200614159bea28a5 /tools | |
| parent | d861e73f86a7c6c7482337e4194d8f9f3ce1f00e (diff) | |
| download | catch3-4ff8b27bb6bed4b8b309e56cd269b4f1fbc24e89.tar.gz | |
Cleanups output normalization in ApprovalTests
Removed:
* NaN normalization
* INFINITY normalization
* errno normalization
* Completely unused duration regex
Tests using these macros should be tagged `[approvals]`
so they are not run as part of approval tests.
Also simplified regex for the test's executable filename,
and hidden some tests relying on nullptr normalization.
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/scripts/approvalTests.py | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/tools/scripts/approvalTests.py b/tools/scripts/approvalTests.py index 59b00d01..36bbdd2f 100755 --- a/tools/scripts/approvalTests.py +++ b/tools/scripts/approvalTests.py @@ -28,7 +28,6 @@ filelocParser = re.compile(r''' ''', re.VERBOSE) lineNumberParser = re.compile(r' line="[0-9]*"') hexParser = re.compile(r'\b(0[xX][0-9a-fA-F]+)\b') -durationsParser = re.compile(r' time="[0-9]*\.[0-9]*"') # Note: junit must serialize time with 3 (or or less) decimal places # before generalizing this parser, make sure that this is checked # in other places too. @@ -39,40 +38,14 @@ versionParser = re.compile(r'Catch2 v[0-9]+\.[0-9]+\.[0-9]+(-\w*\.[0-9]+)?') nullParser = re.compile(r'\b(__null|nullptr)\b') exeNameParser = re.compile(r''' \b - (CatchSelfTest|SelfTest) # Expected executable name + SelfTest # Expected executable name (?:.exe)? # Executable name contains .exe on Windows. \b ''', re.VERBOSE) # This is a hack until something more reasonable is figured out specialCaseParser = re.compile(r'file\((\d+)\)') -# errno macro expands into various names depending on platform, so we need to fix them up as well -errnoParser = re.compile(r''' - \(\*__errno_location\s*\(\)\) - | - \(\*__error\(\)\) - | - \(\*_errno\(\)\) -''', re.VERBOSE) sinceEpochParser = re.compile(r'\d+ .+ since epoch') -infParser = re.compile(r''' - \(\(float\)\(1e\+300\ \*\ 1e\+300\)\) # MSVC INFINITY macro - | - \(__builtin_inff\(\)\) # Linux (ubuntu) INFINITY macro - | - \(__builtin_inff\ \(\)\) # Fedora INFINITY macro - | - __builtin_huge_valf\(\) # OSX macro -''', re.VERBOSE) -nanParser = re.compile(r''' - \(\(float\)\(\(\(float\)\(1e\+300\ \*\ 1e\+300\)\)\ \*\ 0\.0F\)\) # MSVC NAN macro - | - \(\(float\)\(INFINITY\ \*\ 0\.0F\)\) # Yet another MSVC NAN macro - | - \(__builtin_nanf\ \(""\)\) # Linux (ubuntu) NAN macro - | - __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)|(?:ok)|(?:warning)|(?:info)) (\d+) -') @@ -157,10 +130,7 @@ def filterLine(line, isCompact): line = durationParser.sub(' duration="{duration}"', line) line = timestampsParser.sub('{iso8601-timestamp}', line) line = specialCaseParser.sub('file:\g<1>', line) - line = errnoParser.sub('errno', line) line = sinceEpochParser.sub('{since-epoch-report}', line) - line = infParser.sub('INFINITY', line) - line = nanParser.sub('NAN', line) return line |