[evolvis-commits] r17609: merge jenkins-sonar branch; pending merges:↵ Thorsten Glaser 2011-10-21 5.1: rename gforge to src↵ Thorsten Glaser 2011-10-21 EvolvisForge 4.8 Jenkins/Sonar/PHP configuration

mirabilos at evolvis.org mirabilos at evolvis.org
Fri Oct 21 12:13:30 CEST 2011


Author: mirabilos
Date: 2011-10-21 12:13:30 +0200 (Fri, 21 Oct 2011)
New Revision: 17609

Added:
   trunk/gforge_base/evolvisforge-5.1/mvntests/
   trunk/gforge_base/evolvisforge-5.1/mvntests/AllTests.php
   trunk/gforge_base/evolvisforge-5.1/mvntests/syntax/
   trunk/gforge_base/evolvisforge-5.1/mvntests/syntax/AllTests.php
   trunk/gforge_base/evolvisforge-5.1/mvntests/syntax/SyntaxTests.php
   trunk/gforge_base/evolvisforge-5.1/pom.xml
Log:
merge jenkins-sonar branch; pending merges:
  Thorsten Glaser 2011-10-21 5.1: rename gforge to src
    Thorsten Glaser 2011-10-21 EvolvisForge 4.8 Jenkins/Sonar/PHP configuration


Added: trunk/gforge_base/evolvisforge-5.1/mvntests/AllTests.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/mvntests/AllTests.php	                        (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/mvntests/AllTests.php	2011-10-21 10:13:30 UTC (rev 17609)
@@ -0,0 +1,33 @@
+<?php
+if (!defined('PHPUnit_MAIN_METHOD')) {
+	define('PHPUnit_MAIN_METHOD', 'AllTests::main');
+}
+
+require_once 'PHPUnit/Framework.php';
+require_once 'PHPUnit/TextUI/TestRunner.php';
+
+// Code tests
+require_once 'syntax/AllTests.php';
+
+class AllTests
+{
+	public static function main()
+	{
+		PHPUnit_TextUI_TestRunner::run(self::suite());
+	}
+
+	public static function suite()
+	{
+		$suite = new PHPUnit_Framework_TestSuite('PHPUnit');
+
+		// Code tests
+		$suite->addTest(Syntax_AllTests::suite());
+		
+		return $suite;
+	}
+}
+
+if (PHPUnit_MAIN_METHOD == 'AllTests::main') {
+	AllTests::main();
+}
+?>

Added: trunk/gforge_base/evolvisforge-5.1/mvntests/syntax/AllTests.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/mvntests/syntax/AllTests.php	                        (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/mvntests/syntax/AllTests.php	2011-10-21 10:13:30 UTC (rev 17609)
@@ -0,0 +1,18 @@
+<?php
+require_once 'PHPUnit/Framework.php';
+ 
+require_once dirname(__FILE__).'/SyntaxTests.php';
+
+class Syntax_AllTests
+{
+    public static function suite()
+    {
+        $suite = new PHPUnit_Framework_TestSuite('PHPUnit Framework');
+ 
+        $suite->addTestSuite('Syntax_Tests');
+        // ...
+ 
+        return $suite;
+    }
+}
+?>

Added: trunk/gforge_base/evolvisforge-5.1/mvntests/syntax/SyntaxTests.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/mvntests/syntax/SyntaxTests.php	                        (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/mvntests/syntax/SyntaxTests.php	2011-10-21 10:13:30 UTC (rev 17609)
@@ -0,0 +1,56 @@
+<?php
+
+/* depends: moreutils pcregrep */
+
+require_once 'PHPUnit/Framework/TestCase.php';
+
+/**
+ * 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
+ */
+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);
+    }
+
+    /**
+     * 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);
+    }
+
+    /**
+     * 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);
+    }
+}

Added: trunk/gforge_base/evolvisforge-5.1/pom.xml
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/pom.xml	                        (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/pom.xml	2011-10-21 10:13:30 UTC (rev 17609)
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.evolvis.evolvis</groupId>
+  <artifactId>evolvisforge</artifactId>
+  <name>EvolvisForge 5.1</name>
+  <version>5.1-trunk</version>
+  <packaging>pom</packaging>
+  <properties>
+    <sonar.language>php</sonar.language>
+    <sonar.phpUnit.mainTestClass>/mvntests/AllTests.php</sonar.phpUnit.mainTestClass>
+  </properties>
+  <build>
+    <sourceDirectory>${basedir}/src</sourceDirectory>
+    <testSourceDirectory>${basedir}/mvntests</testSourceDirectory>
+  </build>
+</project>



More information about the evolvis-commits mailing list