mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +01:00
Merge pull request #255 from johannesmoene/fix-python-print
Fix python print
This commit is contained in:
commit
878c257de7
@ -1,3 +1,5 @@
|
|||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
@ -66,20 +68,20 @@ def approve( baseName, args ):
|
|||||||
rawFile.close()
|
rawFile.close()
|
||||||
|
|
||||||
os.remove( rawResultsPath )
|
os.remove( rawResultsPath )
|
||||||
print
|
print()
|
||||||
print baseName + ":"
|
print( baseName + ":" )
|
||||||
if os.path.exists( baselinesPath ):
|
if os.path.exists( baselinesPath ):
|
||||||
diffResult = subprocess.call([ "diff", baselinesPath, filteredResultsPath ] )
|
diffResult = subprocess.call([ "diff", baselinesPath, filteredResultsPath ] )
|
||||||
if diffResult == 0:
|
if diffResult == 0:
|
||||||
os.remove( filteredResultsPath )
|
os.remove( filteredResultsPath )
|
||||||
print " \033[92mResults matched"
|
print( " \033[92mResults matched" )
|
||||||
else:
|
else:
|
||||||
print " \n****************************\n \033[91mResults differed"
|
print( " \n****************************\n \033[91mResults differed" )
|
||||||
if diffResult > overallResult:
|
if diffResult > overallResult:
|
||||||
overallResult = diffResult
|
overallResult = diffResult
|
||||||
print "\033[0m"
|
print( "\033[0m" )
|
||||||
else:
|
else:
|
||||||
print " first approval"
|
print( " first approval" )
|
||||||
if overallResult == 0:
|
if overallResult == 0:
|
||||||
overallResult = 1
|
overallResult = 1
|
||||||
|
|
||||||
@ -94,6 +96,6 @@ approve( "junit.sw", ["~_", "-s", "-w", "NoAssertions", "-r", "junit"] )
|
|||||||
# xml reporter, include passes, warn about No Assertions
|
# xml reporter, include passes, warn about No Assertions
|
||||||
approve( "xml.sw", ["~_", "-s", "-w", "NoAssertions", "-r", "xml"] )
|
approve( "xml.sw", ["~_", "-s", "-w", "NoAssertions", "-r", "xml"] )
|
||||||
|
|
||||||
if overallResult <> 0:
|
if overallResult != 0:
|
||||||
print "run approve.py to approve new baselines"
|
print( "run approve.py to approve new baselines" )
|
||||||
exit( overallResult)
|
exit( overallResult)
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import shutil
|
import shutil
|
||||||
@ -18,12 +20,12 @@ def approveFile( approvedFile, unapprovedFile ):
|
|||||||
if os.path.exists( approvedFile ):
|
if os.path.exists( approvedFile ):
|
||||||
os.remove( approvedFile )
|
os.remove( approvedFile )
|
||||||
os.rename( unapprovedFile, approvedFile )
|
os.rename( unapprovedFile, approvedFile )
|
||||||
print "approved " + justFilename
|
print( "approved " + justFilename )
|
||||||
else:
|
else:
|
||||||
print "approval file " + justFilename + " does not exist"
|
print( "approval file " + justFilename + " does not exist" )
|
||||||
|
|
||||||
if len(files) > 0:
|
if len(files) > 0:
|
||||||
for unapprovedFile in files:
|
for unapprovedFile in files:
|
||||||
approveFile( unapprovedFile.replace( "unapproved.txt", "approved.txt" ), unapprovedFile )
|
approveFile( unapprovedFile.replace( "unapproved.txt", "approved.txt" ), unapprovedFile )
|
||||||
else:
|
else:
|
||||||
print "no files to approve"
|
print( "no files to approve" )
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
@ -33,9 +35,9 @@ for arg in sys.argv[1:]:
|
|||||||
elif arg == "noimpl":
|
elif arg == "noimpl":
|
||||||
includeImpl = False
|
includeImpl = False
|
||||||
bumpVersion = False
|
bumpVersion = False
|
||||||
print "Not including impl code (and not bumping version)"
|
print( "Not including impl code (and not bumping version)" )
|
||||||
else:
|
else:
|
||||||
print "\n** Unrecognised argument: " + arg + " **\n"
|
print( "\n** Unrecognised argument: " + arg + " **\n" )
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
out = open( outputPath, 'w' )
|
out = open( outputPath, 'w' )
|
||||||
@ -144,9 +146,9 @@ def generateSingleInclude():
|
|||||||
out.write( " */\n" )
|
out.write( " */\n" )
|
||||||
out.write( "#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED\n" )
|
out.write( "#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED\n" )
|
||||||
out.write( "#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED\n" )
|
out.write( "#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED\n" )
|
||||||
|
|
||||||
parseFile( rootPath, 'catch.hpp' )
|
parseFile( rootPath, 'catch.hpp' )
|
||||||
|
|
||||||
out.write( "#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED\n\n" )
|
out.write( "#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED\n\n" )
|
||||||
|
|
||||||
generateSingleInclude()
|
generateSingleInclude()
|
||||||
|
Loading…
Reference in New Issue
Block a user