Skip to content

Commit 97d1d46

Browse files
committed
Fix build error by not acquiring coverage for the phar tests
1 parent 1318078 commit 97d1d46

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

test.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ fi
99

1010
if [ -n "$1" ]; then
1111
BOOTSTRAP="$1"
12+
MEASURECOVERAGE="0"
1213
else
1314
# You need to run `composer install` to generate this file.
1415
BOOTSTRAP="vendor/autoload.php"
16+
MEASURECOVERAGE="1"
1517
fi
1618

1719
# loading bootstrap should output nothing
1820
load=$(php -r "require '$BOOTSTRAP';")
1921
test -z "$load"
2022

21-
./test/phpunit.sh "$BOOTSTRAP"
23+
./test/phpunit.sh "$BOOTSTRAP" "$MEASURECOVERAGE"
2224
echo ""

test/phpunit.sh

+9-2
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,18 @@ fi
5555
gpg --verify phpunit.phar.asc phpunit.phar
5656
if [ $? -eq 0 ]; then
5757
echo
58+
if [ "$2" -eq "1" ]; then
59+
COVERAGE1_ARGS="--coverage-clover=$parentdir/coverage1.xml -c $parentdir/test/phpunit.xml"
60+
COVERAGE2_ARGS="--coverage-clover=$parentdir/coverage2.xml -c $parentdir/test/phpunit.xml"
61+
else
62+
COVERAGE1_ARGS=""
63+
COVERAGE2_ARGS=""
64+
fi
5865
echo -e "\033[33mBegin Unit Testing\033[0m"
5966
# Run the test suite with normal func_overload.
60-
php -d mbstring.func_overload=0 phpunit.phar --coverage-clover="$parentdir/coverage1.xml" -c "$parentdir/test/phpunit.xml" --bootstrap "$parentdir/$1" "$parentdir/test/unit" && \
67+
php -d mbstring.func_overload=0 phpunit.phar $COVERAGE1_ARGS --bootstrap "$parentdir/$1" "$parentdir/test/unit" && \
6168
# Run the test suite again with funky func_overload.
62-
php -d mbstring.func_overload=7 phpunit.phar --coverage-clover="$parentdir/coverage2.xml" -c "$parentdir/test/phpunit.xml" --bootstrap "$parentdir/$1" "$parentdir/test/unit"
69+
php -d mbstring.func_overload=7 phpunit.phar $COVERAGE2_ARGS --bootstrap "$parentdir/$1" "$parentdir/test/unit"
6370
EXITCODE=$?
6471
# Cleanup
6572
if [ "$clean" -eq 1 ]; then

0 commit comments

Comments
 (0)