Added version number to README (and update it from script)

This commit is contained in:
Phil Nash 2012-11-16 20:43:27 +00:00
parent ef60d54671
commit 0c90ab3572
2 changed files with 16 additions and 0 deletions

3
README
View File

@ -1,3 +1,6 @@
CATCH v0.9 build 2 (integration branch)
---------------------------------------------
CATCH is an automated test framework for C, C++ and Objective-C.
This branch may contain code that is experimental or not yet fully tested.

View File

@ -14,6 +14,7 @@ seenHeaders = set([])
catchPath = os.path.realpath(os.path.dirname(sys.argv[0]))
rootPath = os.path.join( catchPath, 'include/' )
versionPath = os.path.join( rootPath, "internal/catch_version.hpp" )
readmePath = os.path.join( catchPath, "README" )
#outputPath = os.path.join( catchPath, 'single_include/catch.hpp' )
def parseFile( path, filename ):
@ -72,10 +73,22 @@ class Version:
for line in lines:
f.write( line + "\n" )
def updateReadmeFile(self):
f = open( readmePath, 'r' )
lines = []
for line in f:
lines.append( line.rstrip() )
f.close()
f = open( readmePath, 'w' )
f.write( 'CATCH v{0}.{1} build {2} ({3} branch)\n'.format( self.majorVersion, self.minorVersion, self.buildNumber, self.branchName ) )
for line in lines[1:]:
f.write( line + "\n" )
def generateSingleInclude():
v = Version()
v.incrementBuildNumber()
v.updateVersionFile()
v.updateReadmeFile()
print "/*"
print " * CATCH v{0}.{1} build {2} ({3} branch)".format( v.majorVersion, v.minorVersion, v.buildNumber, v.branchName )
print " * Generated: " + str( datetime.datetime.now() )