Ver código fonte

Make hg test optional

Jordi Boggiano 9 anos atrás
pai
commit
ffc421a4fd
1 arquivos alterados com 10 adições e 0 exclusões
  1. 10 0
      tests/Monolog/Processor/MercurialProcessorTest.php

+ 10 - 0
tests/Monolog/Processor/MercurialProcessorTest.php

@@ -20,6 +20,16 @@ class MercurialProcessorTest extends TestCase
      */
      */
     public function testProcessor()
     public function testProcessor()
     {
     {
+        if (defined('PHP_WINDOWS_VERSION_BUILD')) {
+            exec("where hg 2>NUL", $output, $result);
+        } else {
+            exec("which hg 2>/dev/null >/dev/null", $output, $result);
+        }
+        if ($result != 0) {
+            $this->markTestSkipped('hg is missing');
+            return;
+        }
+
         `hg init`;
         `hg init`;
         $processor = new MercurialProcessor();
         $processor = new MercurialProcessor();
         $record = $processor($this->getRecord());
         $record = $processor($this->getRecord());