]> granicus.if.org Git - php/commitdiff
run-tests: fix JUnit counts
authorMax Semenik <maxsem.wiki@gmail.com>
Wed, 10 Feb 2021 22:56:59 +0000 (01:56 +0300)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 11 Feb 2021 08:47:56 +0000 (09:47 +0100)
In 19680f886f, I forgot about my own TODO. At least, now I understand what
this line was about :P

run-tests.php

index 57751309c473f587f1bb2bd4d602a520ea68024f..fb270f0adf4d33707e32264cecfc3c1cea7c3606 100755 (executable)
@@ -1764,7 +1764,7 @@ function run_worker(): void
                     "type" => "tests_finished",
                     "junit" => $junit->isEnabled() ? $junit : null,
                 ]);
-                //junit_init(); TODO is this needed?
+                $junit->clear();
                 break;
             default:
                 send_message($workerSock, [
@@ -3468,6 +3468,12 @@ class JUnit
         return $this->enabled;
     }
 
+    public function clear(): void
+    {
+        $this->rootSuite = self::EMPTY_SUITE + ['name' => 'php'];
+        $this->suites = [];
+    }
+
     public function saveXML(): void
     {
         if (!$this->enabled) {