jit_bugs/bugs/4_infection.sh

47 lines
1000 B
Bash
Raw Normal View History

2023-10-23 22:21:50 +02:00
#!/bin/bash -e
2023-10-23 23:04:58 +02:00
wrap=$PWD/bugs/wrap.php
2023-10-23 23:42:45 +02:00
standalone=$PWD/bugs/infection.php
2023-10-24 17:50:54 +02:00
refactor=$PWD/refactor.php
2023-10-23 22:21:50 +02:00
cd /tmp
rm -rf infection
2023-10-23 22:37:56 +02:00
git clone https://github.com/infection/infection -b 0.27.4
2023-10-23 22:21:50 +02:00
cd infection
composer i --ignore-platform-reqs
2023-10-24 17:50:54 +02:00
php $refactor
2023-10-23 22:21:50 +02:00
cp $standalone .
2023-10-23 23:04:58 +02:00
cp $wrap .
2023-10-23 22:21:50 +02:00
echo "About to run the standalone test"
2023-10-24 10:23:08 +02:00
EXIT_CODE=0
docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php /app/wrap.php /app/infection.php || EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
echo "Failed, exit code $EXIT_CODE"
exit $EXIT_CODE
fi
2023-10-23 22:21:50 +02:00
echo "About to run the testsuite"
2023-10-24 10:23:08 +02:00
EXIT_CODE=0
docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php --repeat 2 -f /app/wrap.php vendor/bin/phpunit || EXIT_CODE=$?
2023-10-23 23:04:58 +02:00
if [ $EXIT_CODE -gt 128 ]; then
2023-10-24 10:23:08 +02:00
echo "Failed, exit code $EXIT_CODE"
2023-10-23 23:04:58 +02:00
exit $EXIT_CODE
fi
2023-10-23 22:21:50 +02:00
echo "About to run composer"
rm -rf vendor
2023-10-23 23:04:58 +02:00
docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php /app/wrap.php /usr/bin/composer update
2023-10-23 22:21:50 +02:00
echo "OK, no bugs!"