From 6c7d68645409cfad3858b5f252f5a49b148e3b53 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 15 Jan 2017 16:31:53 +0100 Subject: Run languages tests using PHPUnit test suites --- .travis.yml | 6 ++++++ Makefile | 16 ++++++++++++++-- composer.json | 3 ++- phpunit.xml | 20 ++++++++++++++++---- 4 files changed, 38 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 03071a47..2a5ff5e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,11 @@ sudo: false language: php +addons: + apt: + packages: + - locales + - language-pack-de + - language-pack-fr cache: directories: - $HOME/.composer/cache diff --git a/Makefile b/Makefile index f3065b77..1d8a73a2 100644 --- a/Makefile +++ b/Makefile @@ -124,8 +124,20 @@ test: @echo "-------" @echo "PHPUNIT" @echo "-------" - @mkdir -p sandbox - @$(BIN)/phpunit tests + @mkdir -p sandbox coverage + @$(BIN)/phpunit --coverage-php coverage/main.cov --testsuite unit-tests + +locale_test_%: + @UT_LOCALE=$*.utf8 \ + $(BIN)/phpunit \ + --coverage-php coverage/$(firstword $(subst _, ,$*)).cov \ + --bootstrap tests/languages/bootstrap.php \ + --testsuite language-$(firstword $(subst _, ,$*)) + +all_tests: test locale_test_de_DE locale_test_en_US locale_test_fr_FR + @$(BIN)/phpcov merge --html coverage coverage + @# --text doesn't work with phpunit 4.* (v5 requires PHP 5.6) + @#$(BIN)/phpcov merge --text coverage/txt coverage ## # Custom release archive generation diff --git a/composer.json b/composer.json index b82aceef..70b87bb9 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,8 @@ "phpmd/phpmd" : "@stable", "phpunit/phpunit": "4.8.*", "sebastian/phpcpd": "*", - "squizlabs/php_codesniffer": "2.*" + "squizlabs/php_codesniffer": "2.*", + "phpunit/phpcov": "*" }, "autoload": { "psr-4": { diff --git a/phpunit.xml b/phpunit.xml index d6e01c35..8b66e6c5 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -3,13 +3,25 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd" colors="true"> + + + tests + tests/languages + + + tests/languages/de + + + tests/languages/en + + + tests/languages/fr + + + application - - - - -- cgit v1.2.3