forked from infection/infection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tests.bash
executable file
·39 lines (31 loc) · 928 Bytes
/
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
#!/usr/bin/env bash
set -e pipefail
readonly INFECTION="../../../bin/infection --coverage=infection-coverage"
readonly PHPUNIT="vendor/bin/phpunit --coverage-xml=infection-coverage/coverage-xml --log-junit=infection-coverage/junit.xml"
if [ "$DRIVER" = "phpdbg" ]
then
phpdbg -qrr $PHPUNIT
else
export XDEBUG_MODE=coverage
php $PHPUNIT
fi
if [ "$DRIVER" = "phpdbg" ]
then
phpdbg -qrr $INFECTION
else
php $INFECTION
fi
if [[ -v GOLDEN ]]; then
cp -v infection.log expected-output_phpunit.txt
fi
diff -u expected-output_phpunit.txt infection.log
if [ -f "infection-cache/infection/phpunit.junit.xml" ]
then
echo "Infection should not generate phpunit.junit.xml if path with existing files has been provided"
exit 1;
fi
if [ -d "infection-cache/infection/coverage-xml" ]
then
echo "Infection should not generate coverage-xml if path with existing files has been provided"
exit 1;
fi