Skip to content

Commit 4934ced

Browse files
committed
Count suites correctly
1 parent b720397 commit 4934ced

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/main/php/xp/test/JSON.class.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class JSON extends Report {
1212
const SLOW= 0.075;
1313
const DATES= 'Y-m-d\TH:i:s.v\Z';
1414

15-
private $out, $start;
15+
private $out, $start, $suites;
1616
private $results= [
1717
'success' => [],
1818
'failure' => [],
@@ -33,6 +33,17 @@ public function __construct($output= '-') {
3333
/** Called when test run starts */
3434
public function start($sources) {
3535
$this->start= Date::now();
36+
$this->suites= 0;
37+
}
38+
39+
/**
40+
* Enter a group
41+
*
42+
* @param test.execution.TestClass $group
43+
* @return void
44+
*/
45+
public function enter($group) {
46+
$this->suites++;
3647
}
3748

3849
/** Called when a test finished */
@@ -72,7 +83,7 @@ public function summary($metrics, $overall, $failures) {
7283
$utc= TimeZone::getByName('UTC');
7384
$report= [
7485
'stats' => [
75-
'suites' => 1,
86+
'suites' => $this->suites,
7687
'tests' => array_sum($metrics->count),
7788
'passes' => $metrics->count['success'],
7889
'pending' => $metrics->count['skipped'],

0 commit comments

Comments
 (0)