Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Do not resolve symbolic path when sanitizing filepath during approvals

Fixes #1691
Commit
52f3abadbb2da954597cda588b07c5e71a49f7e1
Author
Martin Hořeňovský ·
Parents
53281b471f88

Files · Download .tar.gz

Changes

 scripts/approvalTests.py | 8 ++++----
 scripts/scriptCommon.py  | 1 +
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/approvalTests.py b/scripts/approvalTests.py
index bb01e6d5..6e1558dd 100755
--- a/scripts/approvalTests.py
+++ b/scripts/approvalTests.py
@@ -10,13 +10,13 @@ import re
 import difflib
 
 import scriptCommon
-from scriptCommon import catchPath
+from scriptCommon import catchPathSymbolic
 
 if os.name == 'nt':
     # Enable console colours on windows
     os.system('')
 
-rootPath = os.path.join(catchPath, 'projects/SelfTest/Baselines')
+rootPath = os.path.join(catchPathSymbolic, 'projects/SelfTest/Baselines')
 
 langFilenameParser = re.compile(r'(.+\.[ch]pp)')
 filelocParser = re.compile(r'''
@@ -92,9 +92,9 @@ def diffFiles(fileA, fileB):
 
 
 def normalizeFilepath(line):
-    if catchPath in line:
+    if catchPathSymbolic in line:
         # make paths relative to Catch root
-        line = line.replace(catchPath + os.sep, '')
+        line = line.replace(catchPathSymbolic + os.sep, '')
 
     m = langFilenameParser.match(line)
     if m:
diff --git a/scripts/scriptCommon.py b/scripts/scriptCommon.py
index eadf9ff3..60f10bc0 100644
--- a/scripts/scriptCommon.py
+++ b/scripts/scriptCommon.py
@@ -4,6 +4,7 @@ import subprocess
 
 
 catchPath = os.path.dirname(os.path.realpath( os.path.dirname(sys.argv[0])))
+catchPathSymbolic = os.path.dirname(os.path.dirname(sys.argv[0]))
 
 def getBuildExecutable():
     if os.name == 'nt':