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

Method replaceandrun

tools/reduce.py:95–106  ·  view source on GitHub ↗
(self, what, filedata, i, line)

Source from the content-addressed store, hash-verified

93 f.write(line)
94
95 def replaceandrun(self, what, filedata, i, line):
96 print(what + ' ' + str(i + 1) + '/' + str(len(filedata)) + '..')
97 bak = filedata[i]
98 filedata[i] = line
99 self.writefile(filedata)
100 if self.runtool(filedata):
101 print('pass')
102 self.writebackupfile(filedata)
103 return True
104 print('fail')
105 filedata[i] = bak
106 return False
107
108 def replaceandrun2(self, what, filedata, i, line1, line2):
109 print(what + ' ' + str(i + 1) + '/' + str(len(filedata)) + '..')

Callers 4

removecommentsMethod · 0.95
combinelinesMethod · 0.95
removedirectivesMethod · 0.95
removelineMethod · 0.95

Calls 4

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

Tested by

no test coverage detected