r281880 - [analyzer] SATestBuild.py: Treat '#' as comment in projectMap.csv

Devin Coughlin via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 18 18:36:40 PDT 2016


Author: dcoughlin
Date: Sun Sep 18 20:36:40 2016
New Revision: 281880

URL: http://llvm.org/viewvc/llvm-project?rev=281880&view=rev
Log:
[analyzer] SATestBuild.py: Treat '#' as comment in projectMap.csv

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.

Differential Revision: https://reviews.llvm.org/D24709

Modified:
    cfe/trunk/utils/analyzer/SATestBuild.py

Modified: cfe/trunk/utils/analyzer/SATestBuild.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/analyzer/SATestBuild.py?rev=281880&r1=281879&r2=281880&view=diff
==============================================================================
--- cfe/trunk/utils/analyzer/SATestBuild.py (original)
+++ cfe/trunk/utils/analyzer/SATestBuild.py Sun Sep 18 20:36:40 2016
@@ -660,11 +660,17 @@ def testProject(ID, ProjectBuildMode, Is
     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 @@ def testAll(IsReferenceBuild = False, Up
         # 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.




More information about the cfe-commits mailing list