From 97d1d46b55221630e225b2b69d4a0bfb7a6a556b Mon Sep 17 00:00:00 2001 From: Taylor Hornby Date: Mon, 23 Apr 2018 01:29:38 -0400 Subject: [PATCH] Fix build error by not acquiring coverage for the phar tests --- test.sh | 4 +++- test/phpunit.sh | 11 +++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/test.sh b/test.sh index 47ba370..dfdc496 100755 --- a/test.sh +++ b/test.sh @@ -9,14 +9,16 @@ fi if [ -n "$1" ]; then BOOTSTRAP="$1" + MEASURECOVERAGE="0" else # You need to run `composer install` to generate this file. BOOTSTRAP="vendor/autoload.php" + MEASURECOVERAGE="1" fi # loading bootstrap should output nothing load=$(php -r "require '$BOOTSTRAP';") test -z "$load" -./test/phpunit.sh "$BOOTSTRAP" +./test/phpunit.sh "$BOOTSTRAP" "$MEASURECOVERAGE" echo "" diff --git a/test/phpunit.sh b/test/phpunit.sh index e900049..098e5aa 100755 --- a/test/phpunit.sh +++ b/test/phpunit.sh @@ -55,11 +55,18 @@ fi gpg --verify phpunit.phar.asc phpunit.phar if [ $? -eq 0 ]; then echo + if [ "$2" -eq "1" ]; then + COVERAGE1_ARGS="--coverage-clover=$parentdir/coverage1.xml -c $parentdir/test/phpunit.xml" + COVERAGE2_ARGS="--coverage-clover=$parentdir/coverage2.xml -c $parentdir/test/phpunit.xml" + else + COVERAGE1_ARGS="" + COVERAGE2_ARGS="" + fi echo -e "\033[33mBegin Unit Testing\033[0m" # Run the test suite with normal func_overload. - php -d mbstring.func_overload=0 phpunit.phar --coverage-clover="$parentdir/coverage1.xml" -c "$parentdir/test/phpunit.xml" --bootstrap "$parentdir/$1" "$parentdir/test/unit" && \ + php -d mbstring.func_overload=0 phpunit.phar $COVERAGE1_ARGS --bootstrap "$parentdir/$1" "$parentdir/test/unit" && \ # Run the test suite again with funky func_overload. - php -d mbstring.func_overload=7 phpunit.phar --coverage-clover="$parentdir/coverage2.xml" -c "$parentdir/test/phpunit.xml" --bootstrap "$parentdir/$1" "$parentdir/test/unit" + php -d mbstring.func_overload=7 phpunit.phar $COVERAGE2_ARGS --bootstrap "$parentdir/$1" "$parentdir/test/unit" EXITCODE=$? # Cleanup if [ "$clean" -eq 1 ]; then