@@ -792,6 +792,8 @@ function out_symbolic()
792
792
793
793
$ totals = $ this ->initial_results ();
794
794
795
+ $ timers = array ();
796
+
795
797
foreach ($ this as $ test ) {
796
798
$ xunit = $ xml ->addChild ('unit ' );
797
799
$ xunit ->addAttribute ('name ' , $ test ->test_name );
@@ -801,10 +803,19 @@ function out_symbolic()
801
803
$ test ->summaries = $ this ->initial_results ();
802
804
}
803
805
806
+ $ unit_timers = array ();
807
+
804
808
foreach ($ test ->methods as $ methodname => $ messages ) {
805
809
$ xmethod = $ xunit ->addChild ('method ' );
806
810
$ xmethod ->addAttribute ('name ' , $ methodname );
807
811
812
+ foreach ($ test ->timers [$ methodname ] as $ k => $ v ) {
813
+ $ xtimer = $ xmethod ->addChild ('timer ' );
814
+ $ xtimer ->addAttribute ('name ' , $ k );
815
+ $ xtimer ->addAttribute ('value ' , $ v * 1000 );
816
+ $ unit_timers [$ k ] = isset ($ unit_timers [$ k ]) ? $ unit_timers [$ k ] + $ v : $ v ;
817
+ }
818
+
808
819
$ has_output = 0 ;
809
820
foreach ($ messages as $ message ) {
810
821
if (is_string ($ message )) {
@@ -825,6 +836,13 @@ function out_symbolic()
825
836
$ xmethod ->addAttribute ('has_output ' , $ has_output );
826
837
}
827
838
839
+ foreach ($ unit_timers as $ k => $ v ) {
840
+ $ xtimer = $ xunit ->addChild ('timer ' );
841
+ $ xtimer ->addAttribute ('name ' , $ k );
842
+ $ xtimer ->addAttribute ('value ' , $ v * 1000 );
843
+ $ timers [$ k ] = isset ($ timers [$ k ]) ? $ timers [$ k ] + $ v : $ v ;
844
+ }
845
+
828
846
$ summary = $ test ->summaries ;
829
847
foreach ($ summary as $ k => $ v ) {
830
848
if (isset ($ totals [$ k ]) && is_numeric ($ v )) {
@@ -839,6 +857,12 @@ function out_symbolic()
839
857
$ xunit ->addAttribute ('incomplete ' , $ summary ['incomplete_count ' ]);
840
858
}
841
859
860
+ foreach ($ timers as $ k => $ v ) {
861
+ $ xtimer = $ xml ->addChild ('timer ' );
862
+ $ xtimer ->addAttribute ('name ' , $ k );
863
+ $ xtimer ->addAttribute ('value ' , $ v * 1000 );
864
+ }
865
+
842
866
$ xml ->addAttribute ('complete ' , $ totals ['total_case_count ' ]);
843
867
$ xml ->addAttribute ('fail ' , $ totals ['fail_count ' ]);
844
868
$ xml ->addAttribute ('pass ' , $ totals ['pass_count ' ]);
0 commit comments