diff options
-rw-r--r-- | build/build.xml | 42 | ||||
-rw-r--r-- | tests/RUNNING_TESTS.txt | 21 |
2 files changed, 52 insertions, 11 deletions
diff --git a/build/build.xml b/build/build.xml index d21ed99fd7..f9574a3d4d 100644 --- a/build/build.xml +++ b/build/build.xml @@ -11,8 +11,7 @@ <property name="versions" value="${oldversions}, ${newversion}" /> <!-- These are the main targets which you will probably want to use --> - <target name="package" depends="clean,prepare,composer,create-package" /> - <target name="all" depends="clean,prepare,composer,test,docs,create-package" /> + <target name="all" depends="clean,prepare,composer,test,docs,package" /> <target name="build" depends="clean,prepare,composer,test,docs" /> <target name="prepare"> @@ -43,9 +42,15 @@ <delete dir="build/save" /> </target> - <target name="composer" depends="clean,prepare"> - <exec dir="./phpBB/" - command="php ../composer.phar install" + <!-- + This target basically just runs composer in the phpBB tree to ensure + all dependencies are loaded. Additional development dependencies are + loaded because testing framework may depend on them. + --> + <target name="composer"> + <exec dir="phpBB" + command="php ../composer.phar install --dev" + checkreturn="true" passthru="true" /> </target> @@ -122,7 +127,7 @@ </target> - <target name="create-package" depends="prepare-new-version,old-version-diffs"> + <target name="package" depends="clean,prepare,prepare-new-version,old-version-diffs"> <exec dir="build" command="php -f package.php '${versions}' > logs/package.log" escape="false" /> <exec dir="build" command="php -f build_diff.php '${prevversion}' '${newversion}' > logs/build_diff.log" escape="false" /> @@ -162,9 +167,27 @@ command="git archive ${revision} | tar -xf - -C ../${dir}" checkreturn="true" /> - <exec dir="${dir}" - command="php ../composer.phar install" - passthru="true" /> + <!-- + If composer.phar exists in this version of the tree, also export + it into ${dir}, install dependencies, then delete it again. + --> + <exec dir="." + command="git ls-tree ${revision} composer.phar" + checkreturn="true" + outputProperty='composer-ls-tree-output' /> + <if> + <not><equals arg1="${composer-ls-tree-output}" arg2="" trim="true" /></not> + <then> + <exec dir="." + command="git archive ${revision} composer.phar | tar -xf - -C ${dir}" + checkreturn="true" /> + <exec dir="${dir}" + command="php composer.phar install" + checkreturn="true" + passthru="true" /> + <delete file="${dir}/composer.phar" /> + </then> + </if> <delete file="${dir}/config.php" /> <delete dir="${dir}/develop" /> @@ -187,6 +210,7 @@ <delete dir="${dir}/files" /> <delete dir="${dir}/install" /> <delete dir="${dir}/store" /> + <delete dir="${dir}/vendor" /> </target> </project> diff --git a/tests/RUNNING_TESTS.txt b/tests/RUNNING_TESTS.txt index 7c2a7c3fce..de9c751238 100644 --- a/tests/RUNNING_TESTS.txt +++ b/tests/RUNNING_TESTS.txt @@ -17,7 +17,24 @@ PHP extensions Unit tests use several PHP extensions that board code does not use. Currently the following PHP extensions must be installed and enabled to run unit tests: -- ctype +- ctype (also a PHPUnit dependency) +- dom (PHPUnit dependency) + +Some of the functionality in phpBB and/or the test suite uses additional +PHP extensions. If these extensions are not loaded, respective tests +will be skipped: + +- apc (APC cache driver) +- bz2 (compress tests) +- interbase, pdo_firebird (Firebird database driver) +- mysql, pdo_mysql (MySQL database driver) +- mysqli, pdo_mysql (MySQLi database driver) +- pdo (any database tests) +- pgsql, pdo_pgsql (PostgreSQL database driver) +- simplexml (any database tests) +- sqlite, pdo_sqlite (SQLite database driver, requires SQLite 2.x support + in pdo_sqlite) +- zlib (compress tests) Database Tests -------------- @@ -44,7 +61,7 @@ to use in the environment as follows: $ PHPBB_TEST_CONFIG=tests/test_config.php phpunit Alternatively you can specify parameters in the environment, so e.g. the -following will run phpunit with the same parameters as in the shown +following will run PHPUnit with the same parameters as in the shown test_config.php file: $ PHPBB_TEST_DBMS='mysqli' PHPBB_TEST_DBHOST='localhost' \ |