Skip to content
Extraits de code Groupes Projets
Valider da122f87 rédigé par mattpiwik's avatar mattpiwik
Parcourir les fichiers

Forget about previous commit, this is the proper way to debug a failing test!

git-svn-id: http://dev.piwik.org/svn/trunk@7798 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent 128474d6
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -45,9 +45,6 @@ class Piwik_Sql
static public function exec($sql)
{
$db = Zend_Registry::get('db');
if (!is_a($db, 'Zend_Db_Adapter_Abstract')) {
debug_print_backtrace();
}
$profiler = $db->getProfiler();
$q = $profiler->queryStart($sql, Zend_Db_Profiler::INSERT);
$return = self::getDb()->exec($sql);
......
<project name="piwik" default="all" basedir=".">
<property file="build.properties" />
<property file="defaults.properties" />
<property file="build.properties"/>
<property file="defaults.properties"/>
<target name="clean">
<delete dir="${basedir}/results" />
</target>
<target name="clean">
<delete dir="${basedir}/results"/>
</target>
<target name="prepare-build-filesystem" depends="clean">
<mkdir dir="${basedir}/../tmp/templates_c" />
<mkdir dir="${basedir}/../tmp/cache" />
<mkdir dir="${basedir}/../tmp/latest" />
<mkdir dir="${basedir}/../tmp/sessions" />
<mkdir dir="${basedir}/../tmp/assets" />
<chmod perm="a+rw">
<dirset dir="${basedir}/..">
<include name="config" />
<include name="tmp" />
<include name="tmp/**" />
</dirset>
</chmod>
</target>
<target name="prepare-build-filesystem" depends="clean">
<mkdir dir="${basedir}/../tmp/templates_c"/>
<mkdir dir="${basedir}/../tmp/cache"/>
<mkdir dir="${basedir}/../tmp/latest"/>
<mkdir dir="${basedir}/../tmp/sessions"/>
<mkdir dir="${basedir}/../tmp/assets"/>
<target name="phpunit">
<copy file="${basedir}/PHPUnit/phpunit.xml.dist" tofile="${basedir}/PHPUnit/phpunit.xml" overwrite="true">
<filterset>
<filtersfile file="${basedir}/build.properties"/>
</filterset>
</copy>
</target>
<chmod perm="a+rw">
<dirset dir="${basedir}/..">
<include name="config"/>
<include name="tmp"/>
<include name="tmp/**"/>
</dirset>
</chmod>
</target>
<target name="process-build-resources-pdo-mysql" depends="prepare-build-filesystem">
<copy file="${basedir}/config/pdo_mysql.template.php" tofile="${basedir}/../config/config.ini.php" overwrite="true">
<filterset>
<filtersfile file="${basedir}/build.properties"/>
</filterset>
</copy>
</target>
<target name="phpunit">
<copy file="${basedir}/PHPUnit/phpunit.xml.dist" tofile="${basedir}/PHPUnit/phpunit.xml" overwrite="true">
<filterset>
<filtersfile file="${basedir}/build.properties"/>
</filterset>
</copy>
</target>
<target name="test-pdo-mysql" depends="process-build-resources-pdo-mysql">
<echo>PDO_MYSQL unit tests started</echo>
<target name="process-build-resources-pdo-mysql" depends="prepare-build-filesystem">
<copy file="${basedir}/config/pdo_mysql.template.php" tofile="${basedir}/../config/config.ini.php"
overwrite="true">
<filterset>
<filtersfile file="${basedir}/build.properties"/>
</filterset>
</copy>
</target>
<exec executable="phpunit" dir="${basedir}/PHPUnit" failonerror="false" failifexecutionfails="true">
<target name="test-pdo-mysql" depends="process-build-resources-pdo-mysql">
<echo>PDO_MYSQL unit tests started</echo>
<exec executable="phpunit" dir="${basedir}/PHPUnit" failonerror="false" failifexecutionfails="true">
<!-- DEBUG: when test crash in the middle, enable this to see which test crashes. Note: remove \ from -\- below -->
<!--<arg line=" -\-testdox"/>-->
</exec>
<arg line=" -\-testdox"/>
</exec>
<echo>PDO_MYSQL unit tests finished</echo>
</target>
<echo>PDO_MYSQL unit tests finished</echo>
</target>
<target name="process-build-resources-mysqli" depends="prepare-build-filesystem">
<copy file="${basedir}/config/mysqli.template.php" tofile="${basedir}/../config/config.ini.php" overwrite="true">
<filterset>
<filtersfile file="${basedir}/build.properties"/>
</filterset>
</copy>
</target>
<target name="process-build-resources-mysqli" depends="prepare-build-filesystem">
<copy file="${basedir}/config/mysqli.template.php" tofile="${basedir}/../config/config.ini.php"
overwrite="true">
<filterset>
<filtersfile file="${basedir}/build.properties"/>
</filterset>
</copy>
</target>
<target name="test-mysqli" depends="process-build-resources-mysqli">
<echo>MYSQLI unit tests started</echo>
<target name="test-mysqli" depends="process-build-resources-mysqli">
<echo>MYSQLI unit tests started</echo>
<exec executable="phpunit" dir="${basedir}/PHPUnit" failonerror="false" failifexecutionfails="true">
<exec executable="phpunit" dir="${basedir}/PHPUnit" failonerror="false" failifexecutionfails="true">
<!-- DEBUG: when test crash in the middle, enable this to see which test crashes. Note: Remove \ from -\- below -->
<!--<arg line="-\-testdox"/>-->
</exec>
</exec>
<echo>MYSQLI unit tests finished</echo>
</target>
<echo>MYSQLI unit tests finished</echo>
</target>
<target name="all" depends="phpunit,test-pdo-mysql,test-mysqli">
</target>
<target name="all" depends="phpunit,test-pdo-mysql,test-mysqli">
</target>
</project>
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter