forked from infection/infection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tests.bash
executable file
·62 lines (47 loc) · 1.24 KB
/
run_tests.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
set -e
tputx () {
test -x $(which tput) && tput "$@"
}
run () {
local INFECTION=${1}
local PHPARGS=${2}
if [ "$DRIVER" = "phpdbg" ]
then
phpdbg $PHPARGS -qrr $INFECTION
else
php $PHPARGS $INFECTION
fi
}
cd $(dirname "$0")
if [ "$DRIVER" = "phpdbg" ]
then
tputx bold
echo "Will be using phpdbg"
tputx sgr0
fi
tputx bold
echo "Initial test run outside Infection must be successful"
tputx sgr0
if [ "$DRIVER" = "phpdbg" ]
then
PATH=$PATH:bin phpdbg -qrr vendor/bin/phpunit --coverage-xml=coverage/coverage-xml --log-junit=coverage/junit.xml
else
export XDEBUG_MODE=coverage
PATH=$PATH:bin php vendor/bin/phpunit --coverage-xml=coverage/coverage-xml --log-junit=coverage/junit.xml
fi
test -f coverage/junit.xml
test -f coverage/coverage-xml/RunShellScript.php.xml
test -f coverage/coverage-xml/index.xml
tputx bold
echo "PHPUnit finished all right"
echo "Pre-generated coverage..."
tputx sgr0
PATH=$PATH:bin run "../../../bin/infection --coverage=coverage --quiet"
diff -uw expected-output.txt infection.log
tputx bold
echo "Internal coverage..."
tputx sgr0
PATH=$PATH:bin run "../../../bin/infection --quiet"
diff -w expected-output.txt infection.log
rm -vfr coverage