build-sys: check for spicy-screenshot

This commit is contained in:
Marc-André Lureau 2013-11-18 11:28:26 +01:00 committed by Marc-André Lureau
parent a434543eb1
commit 004744fd2f
2 changed files with 7 additions and 7 deletions

View File

@ -140,7 +140,7 @@ AS_IF([test x"$enable_client" != "xno"], [enable_client="yes"])
AM_CONDITIONAL(SUPPORT_CLIENT, test "x$enable_client" = "xyes")
AC_ARG_ENABLE(automated_tests,
[ --enable-automated-tests Enable automated tests using snappy (part of spice--gtk)],,
[ --enable-automated-tests Enable automated tests using spicy-screenshot (part of spice--gtk)],,
[enable_automated_tests="no"])
AS_IF([test x"$enable_automated_tests" != "xno"], [enable_automated_tests="yes"])
AM_CONDITIONAL(SUPPORT_AUTOMATED_TESTS, test "x$enable_automated_tests" != "xno")
@ -399,11 +399,11 @@ AC_SUBST([SASL_CFLAGS])
AC_SUBST([SASL_LIBS])
if test "x$enable_automated_tests" = "xyes"; then
AC_MSG_CHECKING([for snappy/spicy-screenshot])
snappy --help >/dev/null 2>&1 || spicy-screenshot --help >/dev/null 2>&1
AC_MSG_CHECKING([for spicy-screenshot])
spicy-screenshot --help >/dev/null 2>&1
if test $? -ne 0 ; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([snappy/spicy-screenshot was not found, this module is part of spice-gtk and is required to compile this package])
AC_MSG_ERROR([spicy-screenshot was not found, this module is part of spice-gtk and is required to compile this package])
fi
AC_MSG_RESULT([found])
fi

View File

@ -4,8 +4,8 @@ import Image
import ImageChops
def snappy():
cmd = "snappy -h localhost -p 5912 -o output.ppm"
def spicy_screenshot():
cmd = "spicy-screenshot -h localhost -p 5912 -o output.ppm"
p = Popen(cmd, shell=True)
p.wait()
@ -15,7 +15,7 @@ def verify():
return ImageChops.difference(base, output).getbbox()
if __name__ == "__main__":
snappy()
spicy_screenshot()
diff = verify()
if diff is None: