Skip to content

Commit

Permalink
Fix build error by not acquiring coverage for the phar tests
Browse files Browse the repository at this point in the history
  • Loading branch information
defuse committed Apr 23, 2018
1 parent 1318078 commit 97d1d46
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
11 changes: 9 additions & 2 deletions test/phpunit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 97d1d46

Please sign in to comment.