1
0
mirror of https://github.com/danog/math.git synced 2025-01-22 13:41:12 +01:00

Reworked Travis build matrix

Travis now supports merged code coverage reports, so we do not need to merge them ourselves.
This commit is contained in:
Benjamin Morel 2015-05-22 13:39:59 +02:00
parent 9ab6358fc2
commit 49ea5a085e
7 changed files with 14 additions and 40 deletions

View File

@ -5,14 +5,18 @@ php:
- 7
- hhvm
env:
- CALCULATOR=GMP
- CALCULATOR=BCMath
- CALCULATOR=Native
before_script:
- composer self-update
- composer install
- mkdir -p build/cov build/logs
script:
- ./run-all-tests.sh build/cov
- mkdir -p build/cov build/logs
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml
after_script:
- vendor/bin/phpcov merge --clover build/logs/clover.xml build/cov
- vendor/bin/coveralls -v

View File

@ -16,8 +16,7 @@
},
"require-dev": {
"phpunit/phpunit": "*",
"satooshi/php-coveralls": "dev-master",
"phpunit/phpcov": "*"
"satooshi/php-coveralls": "dev-master"
},
"autoload": {
"psr-4": {

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true" bootstrap="vendor/autoload.php">
<testsuites>
<testsuite>
<file>tests/CalculatorDetectTest.php</file>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>src</directory>
</whitelist>
</filter>
</phpunit>

View File

@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true" bootstrap="phpunit-main.php">
<phpunit colors="true" bootstrap="phpunit.php">
<testsuites>
<testsuite>
<directory>tests</directory>
<exclude>tests/CalculatorDetectTest.php</exclude>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory>src</directory>
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>

View File

@ -1,19 +0,0 @@
#!/bin/bash
# Runs all tests.
# Accepts as an optional argument a directory to store the coverage reports.
set -e
DIR=$1
coverage() {
if [[ ! -z $DIR ]]; then
echo "--coverage-php $DIR/$1"
fi
}
CALCULATOR=GMP vendor/bin/phpunit --configuration phpunit-main.xml $(coverage main-gmp.cov)
CALCULATOR=BCMath vendor/bin/phpunit --configuration phpunit-main.xml $(coverage main-bcmath.cov)
CALCULATOR=Native vendor/bin/phpunit --configuration phpunit-main.xml $(coverage main-native.cov)
vendor/bin/phpunit --configuration phpunit-detect.xml $(coverage detect.cov)

View File

@ -11,7 +11,11 @@ class CalculatorDetectTest extends \PHPUnit_Framework_TestCase
{
public function testGetWithNoCalculatorSetDetectsCalculator()
{
$currentCalculator = Calculator::get();
Calculator::set(null);
$this->assertInstanceOf(Calculator::class, Calculator::get());
Calculator::set($currentCalculator);
}
}