From 52f3abadbb2da954597cda588b07c5e71a49f7e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Thu, 18 Jul 2019 16:33:23 +0200 Subject: [PATCH] Do not resolve symbolic path when sanitizing filepath during approvals Fixes #1691 --- 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':