Skip to content

Commit e58bbc0

Browse files
committed
Add timers to symbolic output.
1 parent 90ceadb commit e58bbc0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

bootstrap.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,8 @@ function out_symbolic()
792792

793793
$totals = $this->initial_results();
794794

795+
$timers = array();
796+
795797
foreach($this as $test) {
796798
$xunit = $xml->addChild('unit');
797799
$xunit->addAttribute('name', $test->test_name);
@@ -801,10 +803,19 @@ function out_symbolic()
801803
$test->summaries = $this->initial_results();
802804
}
803805

806+
$unit_timers = array();
807+
804808
foreach($test->methods as $methodname => $messages) {
805809
$xmethod = $xunit->addChild('method');
806810
$xmethod->addAttribute('name', $methodname);
807811

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+
808819
$has_output = 0;
809820
foreach($messages as $message) {
810821
if(is_string($message)) {
@@ -825,6 +836,13 @@ function out_symbolic()
825836
$xmethod->addAttribute('has_output', $has_output);
826837
}
827838

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+
828846
$summary = $test->summaries;
829847
foreach($summary as $k => $v) {
830848
if(isset($totals[$k]) && is_numeric($v)) {
@@ -839,6 +857,12 @@ function out_symbolic()
839857
$xunit->addAttribute('incomplete', $summary['incomplete_count']);
840858
}
841859

860+
foreach($timers as $k => $v) {
861+
$xtimer = $xml->addChild('timer');
862+
$xtimer->addAttribute('name', $k);
863+
$xtimer->addAttribute('value', $v * 1000);
864+
}
865+
842866
$xml->addAttribute('complete', $totals['total_case_count']);
843867
$xml->addAttribute('fail', $totals['fail_count']);
844868
$xml->addAttribute('pass', $totals['pass_count']);

0 commit comments

Comments
 (0)