MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / replaceandrun2

Method replaceandrun2

tools/reduce.py:108–121  ·  view source on GitHub ↗
(self, what, filedata, i, line1, line2)

Source from the content-addressed store, hash-verified

106 return False
107
108 def replaceandrun2(self, what, filedata, i, line1, line2):
109 print(what + ' ' + str(i + 1) + '/' + str(len(filedata)) + '..')
110 bak1 = filedata[i]
111 bak2 = filedata[i + 1]
112 filedata[i] = line1
113 filedata[i + 1] = line2
114 self.writefile(filedata)
115 if self.runtool(filedata):
116 print('pass')
117 self.writebackupfile(filedata)
118 else:
119 print('fail')
120 filedata[i] = bak1
121 filedata[i + 1] = bak2
122
123 def clearandrun(self, what, filedata, i1, i2):
124 print(what + ' ' + str(i1 + 1) + '/' + str(len(filedata)) + '..')

Callers 1

combinelinesMethod · 0.95

Calls 4

writefileMethod · 0.95
runtoolMethod · 0.95
writebackupfileMethod · 0.95
strFunction · 0.85

Tested by

no test coverage detected