Last active
December 31, 2015 17:08
-
-
Save rayward/8017758 to your computer and use it in GitHub Desktop.
phpunit segfault detection wrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# PHP's garbage collector on occasion segfaults upon shutdown. | |
# This script detects a successful build by looking for 'OK' and then terminates successfully. | |
set -o pipefail | |
testcommand="vendor/bin/phpunit -dmemory_limit=-1 --stderr --configuration $1" | |
$testcommand 2>&1 | sudo tee phpunit-output | |
phpunit_success=$? | |
if [ $phpunit_success -gt 0 ]; then | |
echo -e "\nThe command \"$testcommand\" exited with $phpunit_success" | |
fi | |
output=$(cat phpunit-output) | |
if [[ $output =~ $'\n'$'\n'OK ]] ; then | |
exit 0 | |
else | |
exit $phpunit_success | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment