diff --git a/Testsuite/test/parse-ctest-dashboard-xml.py b/Testsuite/test/parse-ctest-dashboard-xml.py index d816ac1e89b..dc8524075ae 100644 --- a/Testsuite/test/parse-ctest-dashboard-xml.py +++ b/Testsuite/test/parse-ctest-dashboard-xml.py @@ -83,12 +83,13 @@ with open_file_create_dir(result_file_name.format(dir=os.getcwd(), tester=tester_name, platform=platform_name), 'a+') as results: for label, tests in tests_per_label.items(): + counts={"n": 0, "w": 0, "t": 0} result_for_label='y' with open_file_create_dir("{}/error.txt".format(label), 'w') as error: for t in tests: print(" {result} {name} in {time} s : {value} ".format(result = "successful " if (t['Status'] == 'passed') else "ERROR: ", name = t['Name'], value = t['ExitValue'] if(t['ExitValue'] != "") else "SUCCESS" , time = t['ExecutionTime']), file=error) if t['Status'] != 'passed': - result_for_label='n' + counts["n"]+=1 elif t['Output'] != None and w_det.search(t['Output']): entries = re.split("\n+", t['Output']) for entry in entries: @@ -96,15 +97,21 @@ with open_file_create_dir(result_file_name.format(dir=os.getcwd(), if m: n = filter_pattern.search(m.group(0)) if n: - result_for_label='w' + counts["w"]+=1 break; else: - result_for_label='t' + counts["t"]+=1 with io.open("{}/ProgramOutput.{}".format(label, t['Name']), mode="w", encoding="utf-8") as f: print("{}/ProgramOutput.{}".format(label, t['Name'])) f.write(t['Output'] if t['Output'] != None else "") + if counts["n"] > 0: + result_for_label='n' + elif counts["w"] > 0: + result_for_label='w' + elif counts["t"] > 0: + result_for_label='t' print("{label} {result}".format(label=label, result=result_for_label), file=results)