Re: [PATCH] D24709: [analyzer] SATestBuild.py: Treat '#' as comment in projectMap.csv
This revision was automatically updated to reflect the committed changes. Closed by commit rL281880: [analyzer] SATestBuild.py: Treat '#' as comment in projectMap.csv (authored by dcoughlin). Changed prior to commit: https://reviews.llvm.org/D24709?vs=71757=71766#toc Repository: rL LLVM https://reviews.llvm.org/D24709 Files: cfe/trunk/utils/analyzer/SATestBuild.py Index: cfe/trunk/utils/analyzer/SATestBuild.py === --- cfe/trunk/utils/analyzer/SATestBuild.py +++ cfe/trunk/utils/analyzer/SATestBuild.py @@ -660,11 +660,17 @@ print "Completed tests for project %s (time: %.2f)." % \ (ID, (time.time()-TBegin)) +def isCommentCSVLine(Entries): + # Treat CSV lines starting with a '#' as a comment. + return len(Entries) > 0 and Entries[0].startswith("#") + def testAll(IsReferenceBuild = False, UpdateSVN = False, Strictness = 0): PMapFile = open(getProjectMapPath(), "rb") try: # Validate the input. for I in csv.reader(PMapFile): +if (isCommentCSVLine(I)): +continue if (len(I) != 2) : print "Error: Rows in the ProjectMapFile should have 3 entries." raise Exception() @@ -682,6 +688,8 @@ # Test the projects. PMapFile.seek(0) for I in csv.reader(PMapFile): +if isCommentCSVLine(I): + continue; testProject(I[0], int(I[1]), IsReferenceBuild, None, Strictness) # Add reference results to SVN. Index: cfe/trunk/utils/analyzer/SATestBuild.py === --- cfe/trunk/utils/analyzer/SATestBuild.py +++ cfe/trunk/utils/analyzer/SATestBuild.py @@ -660,11 +660,17 @@ print "Completed tests for project %s (time: %.2f)." % \ (ID, (time.time()-TBegin)) +def isCommentCSVLine(Entries): + # Treat CSV lines starting with a '#' as a comment. + return len(Entries) > 0 and Entries[0].startswith("#") + def testAll(IsReferenceBuild = False, UpdateSVN = False, Strictness = 0): PMapFile = open(getProjectMapPath(), "rb") try: # Validate the input. for I in csv.reader(PMapFile): +if (isCommentCSVLine(I)): +continue if (len(I) != 2) : print "Error: Rows in the ProjectMapFile should have 3 entries." raise Exception() @@ -682,6 +688,8 @@ # Test the projects. PMapFile.seek(0) for I in csv.reader(PMapFile): +if isCommentCSVLine(I): + continue; testProject(I[0], int(I[1]), IsReferenceBuild, None, Strictness) # Add reference results to SVN. ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D24709: [analyzer] SATestBuild.py: Treat '#' as comment in projectMap.csv
dcoughlin created this revision. dcoughlin added reviewers: zaks.anna, NoQ. dcoughlin added a subscriber: cfe-commits. Treat lines in projectMap.csv that start with '#' as comments. This enables a workflow where projects can be temporarily disabled with a comment describing when they should be turned back on. https://reviews.llvm.org/D24709 Files: utils/analyzer/SATestBuild.py Index: utils/analyzer/SATestBuild.py === --- utils/analyzer/SATestBuild.py +++ utils/analyzer/SATestBuild.py @@ -660,11 +660,17 @@ print "Completed tests for project %s (time: %.2f)." % \ (ID, (time.time()-TBegin)) +def isCommentCSVLine(Entries): + # Treat CSV lines starting with a '#' as a comment. + return len(Entries) > 0 and Entries[0].startswith("#") + def testAll(IsReferenceBuild = False, UpdateSVN = False, Strictness = 0): PMapFile = open(getProjectMapPath(), "rb") try: # Validate the input. for I in csv.reader(PMapFile): +if (isCommentCSVLine(I)): +continue if (len(I) != 2) : print "Error: Rows in the ProjectMapFile should have 3 entries." raise Exception() @@ -682,6 +688,8 @@ # Test the projects. PMapFile.seek(0) for I in csv.reader(PMapFile): +if isCommentCSVLine(I): + continue; testProject(I[0], int(I[1]), IsReferenceBuild, None, Strictness) # Add reference results to SVN. Index: utils/analyzer/SATestBuild.py === --- utils/analyzer/SATestBuild.py +++ utils/analyzer/SATestBuild.py @@ -660,11 +660,17 @@ print "Completed tests for project %s (time: %.2f)." % \ (ID, (time.time()-TBegin)) +def isCommentCSVLine(Entries): + # Treat CSV lines starting with a '#' as a comment. + return len(Entries) > 0 and Entries[0].startswith("#") + def testAll(IsReferenceBuild = False, UpdateSVN = False, Strictness = 0): PMapFile = open(getProjectMapPath(), "rb") try: # Validate the input. for I in csv.reader(PMapFile): +if (isCommentCSVLine(I)): +continue if (len(I) != 2) : print "Error: Rows in the ProjectMapFile should have 3 entries." raise Exception() @@ -682,6 +688,8 @@ # Test the projects. PMapFile.seek(0) for I in csv.reader(PMapFile): +if isCommentCSVLine(I): + continue; testProject(I[0], int(I[1]), IsReferenceBuild, None, Strictness) # Add reference results to SVN. ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits