mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
Refactored scripts to start using a common file
This commit is contained in:
parent
1309da2b55
commit
2278451cd2
@ -3,18 +3,21 @@ import sys
|
||||
import subprocess
|
||||
import re
|
||||
|
||||
from scriptCommon import catchPath
|
||||
|
||||
filenameParser = re.compile( r'\s*.*/(.*\..pp)(.*)' )
|
||||
hexParser = re.compile( r'(.*)\b(0[xX][0-9a-fA-F]+)\b(.*)' )
|
||||
|
||||
catchPath = os.path.realpath(os.path.dirname(sys.argv[0]))
|
||||
baselinesPath = os.path.join( catchPath, '../projects/SelfTest/Baselines/approvedResults.txt' )
|
||||
rawResultsPath = os.path.join( catchPath, '../projects/SelfTest/Baselines/_rawResults.tmp' )
|
||||
filteredResultsPath = os.path.join( catchPath, '../projects/SelfTest/Baselines/unapprovedResults.txt' )
|
||||
#catchPath = os.path.dirname(os.path.realpath( os.path.dirname(sys.argv[0])))
|
||||
|
||||
baselinesPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/approvedResults.txt' )
|
||||
rawResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/_rawResults.tmp' )
|
||||
filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/unapprovedResults.txt' )
|
||||
|
||||
if len(sys.argv) == 2:
|
||||
cmdPath = sys.argv[1]
|
||||
else:
|
||||
cmdPath = "../projects/XCode4/CatchSelfTest/DerivedData/CatchSelfTest/Build/Products/Debug/CatchSelfTest"
|
||||
cmdPath = os.path.join( catchPath, 'projects/XCode4/CatchSelfTest/DerivedData/CatchSelfTest/Build/Products/Debug/CatchSelfTest' )
|
||||
|
||||
f = open( rawResultsPath, 'w' )
|
||||
subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "console" ], stdout=f, stderr=f )
|
||||
|
@ -2,9 +2,10 @@ import os
|
||||
import sys
|
||||
import shutil
|
||||
|
||||
catchPath = os.path.realpath(os.path.dirname(sys.argv[0]))
|
||||
baselinesPath = os.path.join( catchPath, '../projects/SelfTest/Baselines/approvedResults.txt' )
|
||||
filteredResultsPath = os.path.join( catchPath, '../projects/SelfTest/Baselines/unapprovedResults.txt' )
|
||||
from scriptCommon import catchPath
|
||||
|
||||
baselinesPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/approvedResults.txt' )
|
||||
filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/unapprovedResults.txt' )
|
||||
|
||||
if os.path.isfile( filteredResultsPath ):
|
||||
os.remove( baselinesPath )
|
||||
|
@ -3,6 +3,8 @@ import sys
|
||||
import re
|
||||
import datetime
|
||||
|
||||
from scriptCommon import catchPath
|
||||
|
||||
versionParser = re.compile( r'(\s*Version\slibraryVersion)\s*\(\s*(.*)\s*,\s*(.*)\s*,\s*(.*)\s*,\s*\"(.*)\"\s*\).*' )
|
||||
includesParser = re.compile( r'\s*#include\s*"(.*)"' )
|
||||
guardParser = re.compile( r'\s*#.*_INCLUDED')
|
||||
@ -11,10 +13,9 @@ commentParser1 = re.compile( r'^\s*/\*')
|
||||
commentParser2 = re.compile( r'^\s*\*')
|
||||
blankParser = re.compile( r'^\s*$')
|
||||
seenHeaders = set([])
|
||||
catchPath = os.path.realpath(os.path.dirname(sys.argv[0]))
|
||||
rootPath = os.path.join( catchPath, '../include/' )
|
||||
rootPath = os.path.join( catchPath, 'include/' )
|
||||
versionPath = os.path.join( rootPath, "internal/catch_version.hpp" )
|
||||
readmePath = os.path.join( catchPath, "../README.md" )
|
||||
readmePath = os.path.join( catchPath, "README.md" )
|
||||
#outputPath = os.path.join( catchPath, 'single_include/catch.hpp' )
|
||||
|
||||
bumpVersion = len(sys.argv) < 2 or sys.argv[1] <> "nobump"
|
||||
|
4
scripts/scriptCommon.py
Normal file
4
scripts/scriptCommon.py
Normal file
@ -0,0 +1,4 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
catchPath = os.path.dirname(os.path.realpath( os.path.dirname(sys.argv[0])))
|
Loading…
Reference in New Issue
Block a user