def updateReferenceResults(ProjName, ProjBuildMode): ProjDir = SATestBuild.getProjectDir(ProjName) RefResultsPath = os.path.join(ProjDir, SATestBuild.getSBOutputDirName(IsReferenceBuild=True)) CreatedResultsPath = os.path.join(ProjDir, SATestBuild.getSBOutputDirName(IsReferenceBuild=False)) if not os.path.exists(CreatedResultsPath): print >> sys.stderr, "New results not found, was SATestBuild.py "\ "previously run?" sys.exit(-1) # Remove reference results. runCmd('git rm -r "%s"' % (RefResultsPath,)) # Replace reference results with a freshly computed once. runCmd('cp -r "%s" "%s"' % (CreatedResultsPath, RefResultsPath,)) # Run cleanup script. with open(SATestBuild.getBuildLogPath(RefResultsPath), "wb+") as PBuildLogFile: SATestBuild.runCleanupScript(ProjDir, PBuildLogFile) SATestBuild.normalizeReferenceResults(ProjDir, RefResultsPath, ProjBuildMode) # Clean up the generated difference results. SATestBuild.cleanupReferenceResults(RefResultsPath) # Remove the created .diffs file before adding. runCmd('rm -f "%s/*/%s"' % (RefResultsPath, SATestBuild.DiffsSummaryFileName)) runCmd('git add "%s"' % (RefResultsPath,))
def updateReferenceResults(ProjName, ProjBuildMode): ProjDir = SATestBuild.getProjectDir(ProjName) RefResultsPath = os.path.join( ProjDir, SATestBuild.getSBOutputDirName(IsReferenceBuild=True)) CreatedResultsPath = os.path.join( ProjDir, SATestBuild.getSBOutputDirName(IsReferenceBuild=False)) if not os.path.exists(CreatedResultsPath): print("New results not found, was SATestBuild.py " "previously run?", file=sys.stderr) sys.exit(1) BuildLogPath = SATestBuild.getBuildLogPath(RefResultsPath) Dirname = os.path.dirname(os.path.abspath(BuildLogPath)) runCmd("mkdir -p '%s'" % Dirname) with open(BuildLogPath, "w+") as PBuildLogFile: # Remove reference results: in git, and then again for a good measure # with rm, as git might not remove things fully if there are empty # directories involved. runCmd('git rm -r -q "%s"' % (RefResultsPath, ), stdout=PBuildLogFile) runCmd('rm -rf "%s"' % (RefResultsPath, ), stdout=PBuildLogFile) # Replace reference results with a freshly computed once. runCmd('cp -r "%s" "%s"' % ( CreatedResultsPath, RefResultsPath, ), stdout=PBuildLogFile) # Run cleanup script. SATestBuild.runCleanupScript(ProjDir, PBuildLogFile) SATestBuild.normalizeReferenceResults(ProjDir, RefResultsPath, ProjBuildMode) # Clean up the generated difference results. SATestBuild.cleanupReferenceResults(RefResultsPath) runCmd('git add "%s"' % (RefResultsPath, ), stdout=PBuildLogFile)
def updateReferenceResults(ProjName, ProjBuildMode): ProjDir = SATestBuild.getProjectDir(ProjName) RefResultsPath = os.path.join( ProjDir, SATestBuild.getSBOutputDirName(IsReferenceBuild=True)) CreatedResultsPath = os.path.join( ProjDir, SATestBuild.getSBOutputDirName(IsReferenceBuild=False)) if not os.path.exists(CreatedResultsPath): print >> sys.stderr, "New results not found, was SATestBuild.py "\ "previously run?" sys.exit(-1) # Remove reference results: in git, and then again for a good measure # with rm, as git might not remove things fully if there are empty # directories involved. runCmd('git rm -r -q "%s"' % (RefResultsPath, )) runCmd('rm -rf "%s"' % (RefResultsPath, )) # Replace reference results with a freshly computed once. runCmd('cp -r "%s" "%s"' % ( CreatedResultsPath, RefResultsPath, )) # Run cleanup script. BuildLogPath = SATestBuild.getBuildLogPath(RefResultsPath) with open(BuildLogPath, "wb+") as PBuildLogFile: SATestBuild.runCleanupScript(ProjDir, PBuildLogFile) SATestBuild.normalizeReferenceResults(ProjDir, RefResultsPath, ProjBuildMode) # Clean up the generated difference results. SATestBuild.cleanupReferenceResults(RefResultsPath) # Remove the created .diffs file before adding. removeDiffsSummaryFiles(RefResultsPath) runCmd('git add "%s"' % (RefResultsPath, ))
def updateReferenceResults(ProjName, ProjBuildMode): ProjDir = SATestBuild.getProjectDir(ProjName) RefResultsPath = os.path.join( ProjDir, SATestBuild.getSBOutputDirName(IsReferenceBuild=True)) CreatedResultsPath = os.path.join( ProjDir, SATestBuild.getSBOutputDirName(IsReferenceBuild=False)) if not os.path.exists(CreatedResultsPath): print >> sys.stderr, "New results not found, was SATestBuild.py "\ "previously run?" sys.exit(-1) # Remove reference results: in git, and then again for a good measure # with rm, as git might not remove things fully if there are empty # directories involved. runCmd('git rm -r -q "%s"' % (RefResultsPath,)) runCmd('rm -rf "%s"' % (RefResultsPath,)) # Replace reference results with a freshly computed once. runCmd('cp -r "%s" "%s"' % (CreatedResultsPath, RefResultsPath,)) # Run cleanup script. BuildLogPath = SATestBuild.getBuildLogPath(RefResultsPath) with open(BuildLogPath, "wb+") as PBuildLogFile: SATestBuild.runCleanupScript(ProjDir, PBuildLogFile) SATestBuild.normalizeReferenceResults( ProjDir, RefResultsPath, ProjBuildMode) # Clean up the generated difference results. SATestBuild.cleanupReferenceResults(RefResultsPath) # Remove the created .diffs file before adding. removeDiffsSummaryFiles(RefResultsPath) runCmd('git add "%s"' % (RefResultsPath,))