mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-25 14:09:26 +00:00
Split approve file into multiple files
This commit is contained in:
parent
345a4eab9b
commit
2f7a296897
8 changed files with 14604 additions and 14142 deletions
|
@ -1,14 +1,29 @@
|
|||
import os
|
||||
import sys
|
||||
import shutil
|
||||
|
||||
import glob
|
||||
from scriptCommon import catchPath
|
||||
|
||||
baselinesPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/approvedResults.txt' )
|
||||
filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/unapprovedResults.txt' )
|
||||
rootPath = os.path.join( catchPath, 'projects/SelfTest/Baselines' )
|
||||
|
||||
if os.path.isfile( filteredResultsPath ):
|
||||
os.remove( baselinesPath )
|
||||
os.rename( filteredResultsPath, baselinesPath )
|
||||
if len(sys.argv) > 1:
|
||||
files = [os.path.join( rootPath, f ) for f in sys.argv[1:]]
|
||||
else:
|
||||
print "approval file " + filteredResultsPath + " does not exist"
|
||||
files = glob.glob( os.path.join( rootPath, "*.unapproved.txt" ) )
|
||||
|
||||
|
||||
def approveFile( approvedFile, unapprovedFile ):
|
||||
justFilename = unapprovedFile[len(rootPath)+1:]
|
||||
if os.path.exists( unapprovedFile ):
|
||||
if os.path.exists( approvedFile ):
|
||||
os.remove( approvedFile )
|
||||
os.rename( unapprovedFile, approvedFile )
|
||||
print "approved " + justFilename
|
||||
else:
|
||||
print "approval file " + justFilename + " does not exist"
|
||||
|
||||
if len(files) > 0:
|
||||
for unapprovedFile in files:
|
||||
approveFile( unapprovedFile.replace( "unapproved.txt", "approved.txt" ), unapprovedFile )
|
||||
else:
|
||||
print "no files to approve"
|
Loading…
Add table
Add a link
Reference in a new issue