From 33f6fa555ab0be9544a168761c0b996852d401ea Mon Sep 17 00:00:00 2001 From: Alexey Kopytko Date: Fri, 12 Apr 2019 06:23:15 +0900 Subject: [PATCH] run_tests.bash: test only with PCOV --- .../Fixtures/e2e/PCOV_PHPUnit8/run_tests.bash | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 tests/Fixtures/e2e/PCOV_PHPUnit8/run_tests.bash diff --git a/tests/Fixtures/e2e/PCOV_PHPUnit8/run_tests.bash b/tests/Fixtures/e2e/PCOV_PHPUnit8/run_tests.bash new file mode 100755 index 000000000..d0d2c1c0b --- /dev/null +++ b/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 +