llvm.org GIT mirror llvm / fcfa4b8
Support Unsupported Tests in xunit output We were reporting "Unsupported" tests in xunit as passes, however since they are not run, it make more sense to mark them as skipped. The Junit xml standard has support for that, so lets use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332065 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Matthews 1 year, 5 months ago
4 changed file(s) with 24 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
375375 testcase_xml = testcase_template.format(class_name=class_name, test_name=test_name, time=elapsed_time)
376376 fil.write(testcase_xml)
377377 if self.result.code.isFailure:
378 fil.write(">\n\t\n")
378 fil.write(u">\n\t\n")
379379 fil.write(escape(self.result.output))
380 fil.write("\n\t\n")
380 fil.write(u"\n\t\n")
381 elif self.result.code == UNSUPPORTED:
382 fil.write(u">\n\t\n\n")
381383 else:
382 fil.write("/>")
384 fil.write(u"/>")
596596 by_suite[suite] = {
597597 'passes' : 0,
598598 'failures' : 0,
599 'skipped': 0,
599600 'tests' : [] }
600601 by_suite[suite]['tests'].append(result_test)
601602 if result_test.result.code.isFailure:
602603 by_suite[suite]['failures'] += 1
604 elif result_test.result.code == lit.Test.UNSUPPORTED:
605 by_suite[suite]['skipped'] += 1
603606 else:
604607 by_suite[suite]['passes'] += 1
605608 xunit_output_file = open(opts.xunit_output_file, "w")
609612 safe_suite_name = suite_name.replace(".", "-")
610613 xunit_output_file.write("
611614 xunit_output_file.write(" tests='" + str(suite['passes'] +
612 suite['failures']) + "'")
613 xunit_output_file.write(" failures='" + str(suite['failures']) +
615 suite['failures'] + suite['skipped']) + "'")
616 xunit_output_file.write(" failures='" + str(suite['failures']) + "'")
617 xunit_output_file.write(" skipped='" + str(suite['skipped']) +
614618 "'>\n")
619
615620 for result_test in suite['tests']:
616621 result_test.writeJUnitXML(xunit_output_file)
617622 xunit_output_file.write("\n")
22
33 # CHECK:
44 # CHECK-NEXT:
5 # CHECK-NEXT: >
5 # CHECK-NEXT: skipped='5'>
66
77 # CHECK:
88
3131
3232 # CHECK:
3333
34 # CHECK: />
34 # CHECK: >
35 # CHECK-NEXT:
3536
3637 # CHECK:
3738
38 # CHECK: />
39 # CHECK: >
40 # CHECK-NEXT:
3941
4042 # CHECK:
4143
4547 # CHECK-NEXT:
4648
4749
48 # CHECK: />
50 # CHECK: >
51 # CHECK-NEXT:
4952
5053 # CHECK:
5154
52 # CHECK: />
55 # CHECK: >
56 # CHECK-NEXT:
5357
5458 # CHECK:
5559 # CHECK-NEXT:
5660 # CHECK:
5761 # CHECK-NEXT:
5862
59 # CHECK: />
63 # CHECK: >
64 # CHECK-NEXT:
6065
6166 # CHECK:
6267
33
44 # CHECK:
55 # CHECK:
6 # CHECK: >
6 # CHECK: skipped='0'>
77 # CHECK:
88 # CHECK-NEXT:
99 # CHECK-NEXT:& < > "