donate-cpu-server.py: Add checkLibraryUseIgnore report (#1642)

This commit is contained in:
Sebastian 2019-02-04 15:53:51 +01:00 committed by GitHub
parent d24c27c9f8
commit 598cd468f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -30,6 +30,7 @@ def overviewReport():
html += '<a href="time.html">Time report</a><br>\n' 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_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_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>' html += '</body></html>'
return html return html
@ -457,7 +458,7 @@ def timeReport(resultPath):
def check_library_report(result_path, message_id): 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.' error_message = 'Invalid value ' + message_id + ' for message_id parameter.'
print(error_message) print(error_message)
return error_message return error_message
@ -481,10 +482,10 @@ def check_library_report(result_path, message_id):
if not info_messages: if not info_messages:
continue continue
if line.endswith('[' + message_id + ']\n'): if line.endswith('[' + message_id + ']\n'):
if message_id is 'checkLibraryNoReturn': if message_id is 'checkLibraryFunction':
function_name = line[(line.find(': Function ') + len(': Function ')):line.rfind('should have') - 1]
else:
function_name = line[(line.find('for function ') + len('for function ')):line.rfind('[') - 1] 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 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): for function_name, count in sorted(function_counts.iteritems(), key=lambda (k, v): (v, k), reverse=True):
@ -608,6 +609,9 @@ class HttpClientThread(Thread):
elif url == 'check_library_noreturn_report.html': elif url == 'check_library_noreturn_report.html':
text = check_library_report(self.resultPath + '/' + 'info_output', message_id='checkLibraryNoReturn') text = check_library_report(self.resultPath + '/' + 'info_output', message_id='checkLibraryNoReturn')
httpGetResponse(self.connection, text, 'text/html') 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-'): elif url.startswith('check_library-'):
print('check library function !') print('check library function !')
function_name = url[len('check_library-'):] function_name = url[len('check_library-'):]