[evolvis-commits] r18225: amend tests with FF 5.1 syntax checks

mirabilos at evolvis.org mirabilos at evolvis.org
Tue Apr 3 12:19:59 CEST 2012


Author: mirabilos
Date: 2012-04-03 12:19:59 +0200 (Tue, 03 Apr 2012)
New Revision: 18225

Modified:
   trunk/gforge_base/evolvisforge-5.1/Makefile
   trunk/gforge_base/evolvisforge-5.1/mvntests/syntax/SyntaxTests.php
   trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin-devel/00README
   trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin-devel/FusionForge.php.patched
   trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin-devel/FusionForge.php.reference
   trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin-devel/MonoBook.php
   trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin/FusionForge.php
Log:
amend tests with FF 5.1 syntax checks

… and here I thought having THREE DIFFERENT INDENTATION STYLES IN
ONE FILE only happens in FreeBSD® pkgtools…


Modified: trunk/gforge_base/evolvisforge-5.1/Makefile
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/Makefile	2012-04-03 10:06:48 UTC (rev 18224)
+++ trunk/gforge_base/evolvisforge-5.1/Makefile	2012-04-03 10:19:59 UTC (rev 18225)
@@ -1,3 +1,9 @@
+regress:
+	# moreutils phpunit pcregrep
+	test -x /usr/bin/phpunit && test -x /usr/bin/pcregrep && test -x /usr/bin/isutf8
+	php mvntests/AllTests.php
+	@echo minimal testsuite run.
+
 #
 # This Makefile may be used to create packages for distributions
 #
@@ -96,8 +102,3 @@
 
 /etc/apache2/mods-enabled/userdir.load:
 	sudo a2enmod userdir
-
-regress:
-	test -x /usr/bin/phpunit && test -x /usr/bin/pcregrep
-	php mvntests/AllTests.php
-	@echo minimal testsuite run.

Modified: trunk/gforge_base/evolvisforge-5.1/mvntests/syntax/SyntaxTests.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/mvntests/syntax/SyntaxTests.php	2012-04-03 10:06:48 UTC (rev 18224)
+++ trunk/gforge_base/evolvisforge-5.1/mvntests/syntax/SyntaxTests.php	2012-04-03 10:19:59 UTC (rev 18225)
@@ -7,50 +7,102 @@
 /**
  * Syntax test class.
  *
- * @package   SyntaxTests
- * @author    Alain Peyrat <aljeux at free.fr>
- * @copyright 2009 Alain Peyrat. All rights reserved.
- * @license   http://www.opensource.org/licenses/gpl-license.php  GPL License
+ * @package	SyntaxTests
+ * @author	Alain Peyrat <aljeux at free.fr>
+ * @copyright	2009 Alain Peyrat. All rights reserved.
+ * @license	http://www.opensource.org/licenses/gpl-license.php  GPL License
  */
 class Syntax_Tests extends PHPUnit_Framework_TestCase
 {
-    /**
-     * Validate all php code with php -l.
-     */
-    public function testPhpSyntax()
-    {
-	    $output = `find src -name '*.php' -type f  -exec php -l {} \; | grep -v '^No syntax errors detected'`;
-	    $this->assertEquals('', $output);
-    }
+	/**
+	 * 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);
+		}
+	}
 
-    /**
-     * Validate all php code with isutf8.
-     */
-    public function testUTF8Chars()
-    {
-	    // Skip the wiki part which is not UTF-8 encoded.
-	    $output = `find src -name '*.php' -not -path 'src/plugins/wiki/www/*' -type f  -exec isutf8 {} \;`;
-	    $this->assertEquals('', $output);
-	    $output = `find src -name '*.sql' -type f  -exec isutf8 {} \;`;
-	    $this->assertEquals('', $output);
-	    $output = `find src -name '*.sh' -type f  -exec isutf8 {} \;`;
-	    $this->assertEquals('', $output);
-	    $output = `find src -name '*.pl' -type f  -exec isutf8 {} \;`;
-	    $this->assertEquals('', $output);
-    }
+	/**
+	 * Validate all php code with php -l.
+	 */
+	public function testPhpSyntax()
+	{
+		$root = ".";
+		$output = `find $root/src $root/tests -name '*.php' -type f -exec php -l {} \; | grep -v '^No syntax errors detected'`;
+		$this->assertEquals('', $output);
+	}
 
-    /**
-     * Ensure all PHP files use Unix-style line endings
-     */
-    public function testUnixLineEndings()
-    {
-	    $output = `find src -name '*.php' -type f | xargs pcregrep -l '\r$'`;
-	    $this->assertEquals('', $output);
-	    $output = `find src -name '*.sql' -type f | xargs pcregrep -l '\r$'`;
-	    $this->assertEquals('', $output);
-	    $output = `find src -name '*.sh' -type f | xargs pcregrep -l '\r$'`;
-	    $this->assertEquals('', $output);
-	    $output = `find src -name '*.pl' -type f | xargs pcregrep -l '\r$'`;
-	    $this->assertEquals('', $output);
-    }
+	/**
+	 * Validate all scripts with isutf8.
+	 */
+	public function testUTF8Chars()
+	{
+		$root = ".";
+		$output = `find $root/src $root/tests -name '*.php' -type f | xargs isutf8`;
+		$this->assertEquals('', $output);
+		$output = `find $root/src $root/tests -name '*.sql' -type f | xargs isutf8`;
+		$this->assertEquals('', $output);
+		$output = `find $root/src $root/tests -name '*.sh' -type f | xargs isutf8`;
+		$this->assertEquals('', $output);
+		$output = `find $root/src $root/tests -name '*.pl' -type f | xargs isutf8`;
+		$this->assertEquals('', $output);
+	}
+
+	/**
+	 * Ensure all scripts use Unix-style line endings
+	 */
+	public function testUnixLineEndings()
+	{
+		$root = ".";
+		$output = `find $root/src $root/tests -name '*.php' -type f | xargs pcregrep -l '\r$'`;
+		$this->assertEquals('', $output);
+		$output = `find $root/src $root/tests -name '*.sql' -type f | xargs pcregrep -l '\r$'`;
+		$this->assertEquals('', $output);
+		$output = `find $root/src $root/tests -name '*.sh' -type f | xargs pcregrep -l '\r$'`;
+		$this->assertEquals('', $output);
+		$output = `find $root/src $root/tests -name '*.pl' -type f | xargs pcregrep -l '\r$'`;
+		$this->assertEquals('', $output);
+	}
+
+	/**
+	 * Ensure no scripts have SVN conflicts markers
+	 */
+	public function testSVNConflicts()
+	{
+		$root = ".";
+		$output = `find $root/src $root/tests -type f | xargs grep -l '^<<<<<<'`;
+		$this->assertEquals('', $output);
+		$output = `find $root/src $root/tests -type f | xargs grep -l '^>>>>>>'`;
+		$this->assertEquals('', $output);
+	}
+
+	/**
+	 * Ensure no script has an empty last line
+	 */
+	public function testEmptyLastLine()
+	{
+		$root = ".";
+		$output = `find $root/src $root/tests -name '*.php' -type f | while read i ; do [ -s \$i ] && [ -z "\$(tail -n 1 \$i)" ] && echo \$i ; done`;
+		$this->assertEquals('', $output);
+	}
+
+	/**
+	 * Validate syntax of gettextfiles
+	 */
+	public function testGettextSyntax()
+	{
+		$root = ".";
+		$output = `cd $root/src ; ./utils/manage-translations.sh check 2>&1`;
+		$this->assertEquals('', $output);
+	}
 }
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:

Modified: trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin/FusionForge.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin/FusionForge.php	2012-04-03 10:06:48 UTC (rev 18224)
+++ trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin/FusionForge.php	2012-04-03 10:19:59 UTC (rev 18225)
@@ -440,5 +440,3 @@
 	}
 
 } // end of class
-
-

Modified: trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin-devel/00README
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin-devel/00README	2012-04-03 10:06:48 UTC (rev 18224)
+++ trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin-devel/00README	2012-04-03 10:19:59 UTC (rev 18225)
@@ -14,3 +14,5 @@
 
 MonoBook.php and main.css are copied verbatim,
 currently from: mediawiki_1.15.5-1tarent2_all.deb
+
+Empty trailing lines have been removed from: MonoBook.php

Modified: trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin-devel/FusionForge.php.patched
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin-devel/FusionForge.php.patched	2012-04-03 10:06:48 UTC (rev 18224)
+++ trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin-devel/FusionForge.php.patched	2012-04-03 10:19:59 UTC (rev 18225)
@@ -440,5 +440,3 @@
 	}
 
 } // end of class
-
-

Modified: trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin-devel/FusionForge.php.reference
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin-devel/FusionForge.php.reference	2012-04-03 10:06:48 UTC (rev 18224)
+++ trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin-devel/FusionForge.php.reference	2012-04-03 10:19:59 UTC (rev 18225)
@@ -374,5 +374,3 @@
 	}
 
 } // end of class
-
-

Modified: trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin-devel/MonoBook.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin-devel/MonoBook.php	2012-04-03 10:06:48 UTC (rev 18224)
+++ trunk/gforge_base/evolvisforge-5.1/src/plugins/mediawiki/mediawiki-skin-devel/MonoBook.php	2012-04-03 10:19:59 UTC (rev 18225)
@@ -374,5 +374,3 @@
 	}
 
 } // end of class
-
-



More information about the evolvis-commits mailing list