Created
January 7, 2016 08:32
-
-
Save petrknap/d9864d21a90351579d43 to your computer and use it in GitHub Desktop.
Bash macro for batch running of PHPUnit
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
#!/usr/bin/env bash | |
phpunit() { | |
local RETURN_CODE=0 | |
for D in `find . -type f -name "phpunit.xml" -printf "%h\n"` | |
do | |
( | |
cd "$D" | |
echo "${PWD}" | |
command phpunit "$@" | |
if [ "$?" != "0" ] | |
then | |
return 1 | |
fi | |
) | |
if [ "$?" == "1" ] | |
then | |
RETURN_CODE=1 | |
fi | |
echo "" | |
done | |
return ${RETURN_CODE} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment