Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 21 lines (18 sloc) 735 Bytes
#!/usr/bin/env python
import subprocess
import re
import pynotify
pynotify.init("sbt test")
io = subprocess.Popen('sbt ~ test', stdout=subprocess.PIPE).stdout
for line in io:
if re.search("All tests PASSED", line.strip()):
print line
pynotify.Notification("sbt test", "Tests pass.", "dialog-information").show()
elif re.search("Error running test-compile: Compilation unsuccessful", line.strip()):
print line
pynotify.Notification("sbt test", "Compilation failed; tests didn't run.", "dialog-error").show()
elif re.search("Error running test\:", line.strip()):
pynotify.Notification("sbt test", "Tests fail.", "dialog-error").show()
print line
else:
print line