spice/server/tests/regression-test.py
Frediano Ziglio e05cf93a01 tests: Normalize test names
Use dash instead of underscores for file names. This is coherent
with rest of file names.
Rename all tests to test-XXX and remove the spice- prefix when
present. This is coherent with most of the tests.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-11-25 13:52:39 +00:00

26 lines
696 B
Python
Executable File

#!/usr/bin/python
from subprocess import PIPE, Popen
import Image
import ImageChops
def spicy_screenshot():
cmd = "spicy-screenshot -h localhost -p 5912 -o output.ppm"
p = Popen(cmd, shell=True)
p.wait()
def verify():
base = Image.open("base_test.ppm")
output = Image.open("output.ppm")
return ImageChops.difference(base, output).getbbox()
if __name__ == "__main__":
spicy_screenshot()
diff = verify()
if diff is None:
print("\033[1;32mSUCCESS: No regressions were found!\033[1;m")
else:
print("\033[1;31mFAIL: Regressions were found!\n\033[1;m"
"\033[1;31m Please, take a look in your code and go fix it!\033[1;m")