diff --git a/README.md b/README.md index 169b0ebe49e3ed75930e4a382aeb74cf216cc284..1e17e0346d24c6db13f71f2adc017239d26c3b62 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,25 @@ Installation See online documentation at http://vufind.org/wiki/vufind2:installation_notes +Testing +------- + +For performing all ci-tasks you have to add all dev-dependencies. Do so like this + + php composer.phar update +this adds all necessary tools like phing, phpunit, etc + +After that you can perform the task with the following command + + phing + be aware that you need several programs like java and mysql to setup a solr-index and a database-store in order to +test the components of vufind that communicate with them + +You might need to set up the mysql-user credentials should they not agree with your mysql root-users credentials. +you can do that by providing optional parameters like that + + phing -Dmysqlrootpass='' + do so if you have no rootpassword set. the default password is 'password' Modules ------- @@ -19,4 +38,4 @@ Modules * all non-global non-community modules go to module/finc/ - + \ No newline at end of file diff --git a/build.xml b/build.xml index b10ba41e6bdcc7cec25874e7fce22bc6f236d019..c3aa62d1e7e09d09d35eb0d639b74225b8090941 100644 --- a/build.xml +++ b/build.xml @@ -4,6 +4,7 @@ <property name="package" value="${phing.project.name}" override="true" /> <property name="builddir" value="${tmp}/build/${phing.project.name}" override="true" /> <property name="srcdir" value="${project.basedir}" override="true" /> + <property name="composerdir" value="${srcdir}/vendor/bin" /> <property name="apacheconfdir" value="/etc/apache2/conf.d" /> <property name="apachectl" value="false" /><!-- set to apachectl path to spin up Apache instance --> <property name="nodepath" value="" /><!-- set to node.js modules path to use Zombie.js testing --> @@ -63,27 +64,27 @@ <!-- Report rule violations with PHPMD (mess detector) --> <target name="phpmd"> - <exec command="phpmd ${srcdir}/module xml ${srcdir}/tests/phpmd.xml --exclude ${srcdir}/module/VuFind/tests,${srcdir}/module/VuDL/tests,${srcdir}/module/VuFindSearch/tests --reportfile ${builddir}/reports/phpmd.xml" /> + <exec command="${composerdir}/phpmd ${srcdir}/module xml ${srcdir}/tests/phpmd.xml --exclude ${srcdir}/module/VuFind/tests,${srcdir}/module/VuDL/tests,${srcdir}/module/VuFindSearch/tests --reportfile ${builddir}/reports/phpmd.xml" /> </target> <!-- Measure project with phploc --> <target name="phploc"> - <exec command="phploc --log-csv ${builddir}/reports/phploc.csv ${srcdir}/module" /> + <exec command="${composerdir}/phploc --log-csv ${builddir}/reports/phploc.csv ${srcdir}/module" /> </target> <!-- PHP_Depend code analysis --> <target name="pdepend"> - <exec command="pdepend --jdepend-xml=${builddir}/reports/jdepend.xml --jdepend-chart=${builddir}/reports/dependencies.svg --overview-pyramid=${builddir}/reports/pdepend-pyramid.svg ${srcdir}/module" /> + <exec command="${composerdir}/pdepend --jdepend-xml=${builddir}/reports/jdepend.xml --jdepend-chart=${builddir}/reports/dependencies.svg --overview-pyramid=${builddir}/reports/pdepend-pyramid.svg ${srcdir}/module" /> </target> <!-- PHP copy-and-paste detection --> <target name="phpcpd"> - <exec command="phpcpd --log-pmd ${builddir}/reports/pmd-cpd.xml --exclude tests ${srcdir}/module" /> + <exec command="${composerdir}/phpcpd --log-pmd ${builddir}/reports/pmd-cpd.xml --exclude tests ${srcdir}/module" /> </target> <!-- PHP CodeSniffer --> <target name="phpcs"> - <exec command="phpcs --standard=PEAR --ignore=*/config/*,*/tests/* --extensions=php --report=checkstyle ${srcdir}/module > ${builddir}/reports/checkstyle.xml" escape="false" /> + <exec command="${composerdir}/phpcs --standard=PEAR --ignore=*/config/*,*/tests/* --extensions=php --report=checkstyle ${srcdir}/module > ${builddir}/reports/checkstyle.xml" escape="false" /> </target> <!-- PHP API Documentation --> @@ -99,12 +100,12 @@ <!-- PHPUnit --> <target name="phpunit" description="Run tests"> - <exec dir="${srcdir}/module/VuFind/tests" command="NODE_PATH=${nodepath} VUFIND_LOCAL_DIR=${srcdir}/local VUFIND_URL=${vufindurl} phpunit -dzend.enable_gc=0 --log-junit ${builddir}/reports/phpunit.xml --coverage-clover ${builddir}/reports/coverage/clover.xml --coverage-html ${builddir}/reports/coverage/" passthru="true" checkreturn="true" /> + <exec dir="${srcdir}/module/VuFind/tests" command="NODE_PATH=${nodepath} VUFIND_LOCAL_DIR=${srcdir}/local VUFIND_URL=${vufindurl} ${composerdir}/phpunit -dzend.enable_gc=0 --log-junit ${builddir}/reports/phpunit.xml --coverage-clover ${builddir}/reports/coverage/clover.xml --coverage-html ${builddir}/reports/coverage/" passthru="true" checkreturn="true" /> </target> <!-- PHPUnit without logging output --> <target name="phpunitfast" description="Run tests"> - <exec dir="${srcdir}/module/VuFind/tests" command="NODE_PATH=${nodepath} VUFIND_LOCAL_DIR=${srcdir}/local VUFIND_URL=${vufindurl} phpunit -dzend.enable_gc=0" passthru="true" checkreturn="true" /> + <exec dir="${srcdir}/module/VuFind/tests" command="NODE_PATH=${nodepath} VUFIND_LOCAL_DIR=${srcdir}/local VUFIND_URL=${vufindurl} ${composerdir}/phpunit -dzend.enable_gc=0" passthru="true" checkreturn="true" /> </target> <!-- Install and Activate VuFind --> diff --git a/composer.json b/composer.json index ea3e48a0c9bf89ed094916687fc16aca84e76dd9..449fafe3e446bbd729683c41bc17d698778a6ab4 100644 --- a/composer.json +++ b/composer.json @@ -67,6 +67,14 @@ }, "require-dev": { "behat/mink": "1.6.*", - "behat/mink-zombie-driver": "*" + "behat/mink-zombie-driver": "*", + "phing/phing": "2.*", + "phpunit/phpunit": "4.3.*", + "pear-pear.php.net/php_codesniffer": "*", + "phpdocumentor/phpdocumentor": "~2.9", + "sebastian/phpcpd": "*", + "phpmd/phpmd": "@stable", + "czproject/phpdepend": "*", + "phploc/phploc": "*" } } diff --git a/composer.phar b/composer.phar new file mode 100755 index 0000000000000000000000000000000000000000..3369e817eddb9e055a9644cb6005dcfddd156331 Binary files /dev/null and b/composer.phar differ