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

summaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorMartin Hořeňovský2017-06-05 17:19:42 +0200
committerMartin Hořeňovský2017-06-05 17:19:42 +0200
commit7f6773bb4d4bcdb7858e63f906e8a80e746bea7e (patch)
tree947fb02bfb2c860cffd6b08c29b461f17bf3c64d /scripts
parentb459bb4c431670cb3031a68f4b3cf79f631d0c48 (diff)
parent3e018ef131878f32950d3622300e282c1c8a6594 (diff)
downloadcatch3-7f6773bb4d4bcdb7858e63f906e8a80e746bea7e.tar.gz
Merge branch 'master' into dev-modernize
Hopefully nothing went too wrong.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/approvalTests.py14
-rw-r--r--scripts/updateVcpkgPackage.py1
2 files changed, 12 insertions, 3 deletions
diff --git a/scripts/approvalTests.py b/scripts/approvalTests.py
index b1b1d65d..3b71be3e 100755
--- a/scripts/approvalTests.py
+++ b/scripts/approvalTests.py
@@ -36,6 +36,13 @@ exeNameParser = re.compile(r'''
# 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\ \(\)\)
+ |
+ \(\*__error\(\)\)
+''', re.VERBOSE)
+
if len(sys.argv) == 2:
cmdPath = sys.argv[1]
else:
@@ -45,9 +52,9 @@ overallResult = 0
def diffFiles(fileA, fileB):
with open(fileA, 'r') as file:
- aLines = file.readlines()
+ aLines = [line.rstrip() for line in file.readlines()]
with open(fileB, 'r') as file:
- bLines = file.readlines()
+ bLines = [line.rstrip() for line in file.readlines()]
shortenedFilenameA = fileA.rsplit(os.sep, 1)[-1]
shortenedFilenameB = fileB.rsplit(os.sep, 1)[-1]
@@ -90,6 +97,7 @@ def filterLine(line):
line = durationsParser.sub(' time="{duration}"', line)
line = timestampsParser.sub(' timestamp="{iso8601-timestamp}"', line)
line = specialCaseParser.sub('file:\g<1>', line)
+ line = errnoParser.sub('errno', line)
return line
@@ -119,7 +127,7 @@ def approve(baseName, args):
if os.path.exists(baselinesPath):
diffResult = diffFiles(baselinesPath, filteredResultsPath)
if diffResult:
- print(''.join(diffResult))
+ print('\n'.join(diffResult))
print(" \n****************************\n \033[91mResults differed")
if len(diffResult) > overallResult:
overallResult = len(diffResult)
diff --git a/scripts/updateVcpkgPackage.py b/scripts/updateVcpkgPackage.py
index 299e9f3b..a7c8dee6 100644
--- a/scripts/updateVcpkgPackage.py
+++ b/scripts/updateVcpkgPackage.py
@@ -96,6 +96,7 @@ def git_push(path_to_repo):
# Update repo to current master, so we don't work off old version of the portsfile
subprocess.call('git pull Microsoft master', shell=True)
+ subprocess.call('git push', shell=True)
# Create a new branch for the update
subprocess.call('git checkout -b catch-{}'.format(ver_string), shell=True)