[Fusionforge-commits] r9382 - trunk/tests/code/syntax

Olivier Berger olberger at libremir.placard.fr.eu.org
Tue Apr 6 18:19:47 CEST 2010


Author: olberger
Date: 2010-04-06 18:19:47 +0200 (Tue, 06 Apr 2010)
New Revision: 9382

Modified:
   trunk/tests/code/syntax/SyntaxTest.php
Log:
Adding tests to check the environment is setup the right way


Modified: trunk/tests/code/syntax/SyntaxTest.php
===================================================================
--- trunk/tests/code/syntax/SyntaxTest.php	2010-04-06 16:12:36 UTC (rev 9381)
+++ trunk/tests/code/syntax/SyntaxTest.php	2010-04-06 16:19:47 UTC (rev 9382)
@@ -12,6 +12,31 @@
  */
 class Syntax_Tests extends PHPUnit_Framework_TestCase
 {
+  /**
+   * First, make sure pcregrep is installed
+   */
+  public function testPcRegrepInstalled()
+  {
+    $output = `type pcregrep >/dev/null; echo $?`;
+    $rc = trim($output);
+    if ($rc != '0') {
+      $output = `type pcregrep`;
+      $this->fail('You should probably install "pcregrep" : `type pcregrep` reports "'.$output);
+    }
+  }
+
+  /**
+   * First, make sure it is run from inside the tests/ subdir
+   */
+  public function testPath()
+  {
+    $output = `ls ../gforge >/dev/null; echo $?`;
+    $rc = trim($output);
+    if ($rc != '0') {
+      $output = `ls ../gforge`;
+      $this->fail('Must be run from inside the "tests/" subdir : `ls ../gforge` reports "'.$output);
+    }
+  }
     /**
      * Validate all php code with php -l.
      */




More information about the Fusionforge-commits mailing list