Skip to content

Instantly share code, notes, and snippets.

@petrknap
Created January 7, 2016 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petrknap/d9864d21a90351579d43 to your computer and use it in GitHub Desktop.
Save petrknap/d9864d21a90351579d43 to your computer and use it in GitHub Desktop.
Bash macro for batch running of PHPUnit
#!/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