MCPcopy Create free account
hub / github.com/Kitware/VTK / CheckExclude

Method CheckExclude

Testing/Core/HeaderTesting.py:130–165  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

128 return not self.CheckExclude()
129
130 def CheckExclude(self):
131 self.ExcludeNamespaceCheck = False
132 self.ExcludeTypeMacro = False
133 prefix = '// VTK-HeaderTest-Exclude:'
134 prefix_c = '/* VTK-HeaderTest-Exclude:'
135 suffix_c = ' */'
136 exclude = 0
137 for l in self.FileLines:
138 e = None
139 if l.startswith(prefix):
140 e = l[len(prefix):].strip()
141 elif l.startswith(prefix_c) and l.rstrip().endswith(suffix_c):
142 e = l[len(prefix_c):-len(suffix_c)].strip()
143
144 if not e == None:
145 if e == os.path.basename(self.FileName):
146 exclude += 1
147 else:
148 hasExclusions = False
149 if "INCLUDES" in e:
150 hasExclusions = True
151 self.HasIncludes = False
152 if "ABINAMESPACE" in e:
153 hasExclusions = True
154 self.ExcludeNamespaceCheck = True
155 if "CLASSES" in e:
156 hasExclusions = True
157 self.HasClass = False
158 if "TYPEMACRO" in e:
159 hasExclusions = True
160 self.ExludeTypeMacro = True
161 if not hasExclusions:
162 self.Error("Wrong exclusion: "+l.rstrip())
163 if exclude > 1:
164 self.Error("Multiple VTK-HeaderTest-Exclude lines")
165 return exclude > 0
166
167 def CheckABINamespace(self):
168 if self.ExcludeNamespaceCheck:

Callers 1

TestFileMethod · 0.95

Calls 1

ErrorMethod · 0.95

Tested by

no test coverage detected