Skip to content

Commit

Permalink
run_tests.bash: test only with PCOV
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmai committed Apr 11, 2019
1 parent 1bb997a commit 33f6fa5
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions tests/Fixtures/e2e/PCOV_PHPUnit8/run_tests.bash
@@ -0,0 +1,52 @@
#!/usr/bin/env bash

set -e

tputx () {
test -x $(which tput) && tput "$@"
}

run () {
local INFECTION=${1}
local PHPARGS=${2}

if [ "$PHPDBG" = "1" ]
then
phpdbg $PHPARGS -qrr $INFECTION
else
php $PHPARGS $INFECTION
fi
}

cd $(dirname "$0")

if [ "$PHPDBG" = "1" ]
then
exit 0
fi

if php -r "exit(version_compare(PHP_VERSION, '7.3.0'));"
then
exit 0
fi

tputx bold
echo "Checking for PCOV..."
tputx sgr0


if ! php --ri pcov
then
tput setaf 1 # red
echo "PCOV not detected"
exit 0
fi

readonly INFECTION=../../../../${1}

set -e pipefail

php $INFECTION

diff -w expected-output.txt infection.log

0 comments on commit 33f6fa5

Please sign in to comment.