Skip to content

Instantly share code, notes, and snippets.

@indare
Created June 14, 2012 04:12
Show Gist options
  • Save indare/2927949 to your computer and use it in GitHub Desktop.
Save indare/2927949 to your computer and use it in GitHub Desktop.
phpUnitRunner
def phpUnitPath = '/opt/local/bin/'
def targetTestClass = '/workspace/cron/test/TestCheckMembers.php'
def cmd = phpUnitPath + 'phpunit ' + targetTestClass
def p = Runtime.getRuntime().exec(cmd)
def r = p.getInputStream().newReader('UTF-8')
r.eachLine{
if((~/OK \(/).matcher(it).find()){
Runtime.getRuntime().exec('/usr/local/bin/growlnotify -t phpUnit -m Green --image /Green.png')
}
else if ((~/Fatal/).matcher(it).find()){
Runtime.getRuntime().exec('/usr/local/bin/growlnotify -t phpUnit -m Fatal --image /Fatal.png')
}
else if ((~/Tests:/).matcher(it).find()){
Runtime.getRuntime().exec('/usr/local/bin/growlnotify -t phpUnit -m Red --image /Red.png')
}
}
r.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment