From 598cd468f1e899c2b88a3d8e2a3075a40175e5de Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 4 Feb 2019 15:53:51 +0100 Subject: [PATCH] donate-cpu-server.py: Add checkLibraryUseIgnore report (#1642) --- tools/donate-cpu-server.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/donate-cpu-server.py b/tools/donate-cpu-server.py index 6ea794cde..3456e92f8 100644 --- a/tools/donate-cpu-server.py +++ b/tools/donate-cpu-server.py @@ -30,6 +30,7 @@ def overviewReport(): html += 'Time report
\n' html += 'checkLibraryFunction report
\n' html += 'checkLibraryNoReturn report
\n' + html += 'checkLibraryUseIgnore report
\n' html += '' return html @@ -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 @@ -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): @@ -608,6 +609,9 @@ class HttpClientThread(Thread): 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-'):]