diff --git a/suite/cstest/cstest_report.py b/suite/cstest/cstest_report.py index 17da3957..a4883eef 100755 --- a/suite/cstest/cstest_report.py +++ b/suite/cstest/cstest_report.py @@ -9,7 +9,7 @@ import os def Usage(s): - print 'Usage: {} -t [-f ] [-d ]'.format(s) + print('Usage: {} -t [-f ] [-d ]'.format(s)) sys.exit(-1) def get_report_file(toolpath, filepath, getDetails, cmt_out): @@ -19,8 +19,8 @@ def get_report_file(toolpath, filepath, getDetails, cmt_out): # stdout failed_tests = [] -# print '---> stdout\n', stdout -# print '---> stderr\n', stderr +# print('---> stdout\n', stdout) +# print('---> stderr\n', stderr) matches = re.finditer(r'\[\s+RUN\s+\]\s+(.*)\n\[\s+FAILED\s+\]', stdout) for match in matches: failed_tests.append(match.group(1)) @@ -41,12 +41,12 @@ def get_report_file(toolpath, filepath, getDetails, cmt_out): counter += 1 else: continue - print '\n[-] There are/is {} failed test(s)'.format(len(details)) + print('\n[-] There are/is {} failed test(s)'.format(len(details))) if len(details) > 0 and getDetails: - print '[-] Detailed report for {}:\n'.format(filepath) + print('[-] Detailed report for {}:\n'.format(filepath)) for c, f, d in details: - print '\t[+] {}: {}\n\t\t{}\n'.format(f, c, d) - print '\n' + print('\t[+] {}: {}\n\t\t{}\n'.format(f, c, d)) + print('\n') return 0 elif len(details) > 0: for c, f, d in details: @@ -67,7 +67,7 @@ def get_report_folder(toolpath, folderpath, details, cmt_out): path = root.split(os.sep) for f in files: if f.split('.')[-1] == 'cs': - print '[-] Target:', f, + print('[-] Target:', f,) result *= get_report_file(toolpath, os.sep.join(x for x in path) + os.sep + f, details, cmt_out) sys.exit(result ^ 1)