Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions tools/donate-cpu-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def overviewReport():
html += '<a href="time.html">Time report</a><br>\n'
html += '<a href="check_library_function_report.html">checkLibraryFunction report</a><br>\n'
html += '<a href="check_library_noreturn_report.html">checkLibraryNoReturn report</a><br>\n'
html += '<a href="check_library_use_ignore_report.html">checkLibraryUseIgnore report</a><br>\n'
html += '</body></html>'
return html

Expand Down Expand Up @@ -457,7 +458,7 @@ def timeReport(resultPath):


def check_library_report(result_path, message_id):
if message_id not in ('checkLibraryNoReturn', 'checkLibraryFunction'):
if message_id not in ('checkLibraryNoReturn', 'checkLibraryFunction', 'checkLibraryUseIgnore'):
error_message = 'Invalid value ' + message_id + ' for message_id parameter.'
print(error_message)
return error_message
Expand All @@ -481,10 +482,10 @@ def check_library_report(result_path, message_id):
if not info_messages:
continue
if line.endswith('[' + message_id + ']\n'):
if message_id is 'checkLibraryNoReturn':
function_name = line[(line.find(': Function ') + len(': Function ')):line.rfind('should have') - 1]
else:
if message_id is 'checkLibraryFunction':
function_name = line[(line.find('for function ') + len('for function ')):line.rfind('[') - 1]
else:
function_name = line[(line.find(': Function ') + len(': Function ')):line.rfind('should have') - 1]
function_counts[function_name] = function_counts.setdefault(function_name, 0) + 1

for function_name, count in sorted(function_counts.iteritems(), key=lambda (k, v): (v, k), reverse=True):
Expand Down Expand Up @@ -608,6 +609,9 @@ def run(self):
elif url == 'check_library_noreturn_report.html':
text = check_library_report(self.resultPath + '/' + 'info_output', message_id='checkLibraryNoReturn')
httpGetResponse(self.connection, text, 'text/html')
elif url == 'check_library_use_ignore_report.html':
text = check_library_report(self.resultPath + '/' + 'info_output', message_id='checkLibraryUseIgnore')
httpGetResponse(self.connection, text, 'text/html')
elif url.startswith('check_library-'):
print('check library function !')
function_name = url[len('check_library-'):]
Expand Down