@@ -497,23 +497,21 @@ sub mtr_report_stats ($$$$) {
497
497
$test_time = sprintf (" %.3f" , $test -> {timer } / 1000);
498
498
$test -> {' name' } =~ s / $current_suite\. // ;
499
499
500
- my $test_result ;
501
-
502
- # if a test case has to be retried it should have the result MTR_RES_FAILED in jUnit XML
503
- if ($test -> {' retries' } > 0) {
504
- $test_result = " MTR_RES_FAILED" ;
500
+ my $combinations ;
501
+ if (defined ($test -> {combinations })){
502
+ $combinations = join ' ,' , sort @{$test -> {combinations }};
505
503
} else {
506
- $test_result = $test -> { ' result ' } ;
504
+ $combinations = " " ;
507
505
}
508
506
509
- $xml_report .= qq( \t\t <testcase assertions="" classname="$current_suite " name="$test ->{'name'}" status="$test_result " time="$test_time ") ;
507
+ $xml_report .= qq( \t\t <testcase assertions="" classname="$current_suite " name="$test ->{'name'}" ) .
508
+ qq( status="$test ->{'result'}" time="$test_time " combinations="$combinations ") ;
510
509
511
- my $comment = $test -> {' comment' };
512
- $comment =~ s / [\" ]// g ;
510
+ my $comment = replace_special_symbols($test -> {' comment' });
513
511
514
- # if a test case has to be retried it should have the result MTR_RES_FAILED in jUnit XML
515
- if ($test -> {' result' } eq " MTR_RES_FAILED" || $test -> {' retries' } > 0) {
512
+ if ($test -> {' result' } eq " MTR_RES_FAILED" ) {
516
513
my $logcontents = $test -> {' logfile-failed' } || $test -> {' logfile' };
514
+ $logcontents = $logcontents .$test -> {' warnings' }." \n " ;
517
515
# remove any double ] that would end the cdata
518
516
$logcontents =~ s / ]]/ \x{fffd} / g ;
519
517
# replace wide characters that aren't allowed in XML 1.0
@@ -576,6 +574,16 @@ sub mtr_print_line () {
576
574
print ' -' x 74 . " \n " ;
577
575
}
578
576
577
+ sub replace_special_symbols ($) {
578
+ my $text = shift ;
579
+ $text =~ s / &/ &/ g ;
580
+ $text =~ s / '/ '/ g ;
581
+ $text =~ s / "/ "/ g ;
582
+ $text =~ s / </ </ g ;
583
+ $text =~ s / >/ >/ g ;
584
+ return $text ;
585
+ }
586
+
579
587
580
588
sub mtr_print_thick_line {
581
589
my $char = shift || ' =' ;
0 commit comments