Commit 7e25248f authored by Jehan's avatar Jehan

desktop: add a test for strict validation of appdata file.

This way we can be warned quickly about any AppStream issue (cf. bug
782759). This test requires web access for screenshot verification.
Packagers are invited to use --without-appdata-test option if they want
to skip the test (for instance if build environment has restricted
network access).
parent 7e224888
......@@ -2196,6 +2196,26 @@ if test "x$with_xvfb_run" != "xno"; then
fi
AM_CONDITIONAL(HAVE_XVFB_RUN, test "x$have_xvfb_run" = "xyes")
##########################
# Check for appstream-util
##########################
AC_ARG_WITH(appdata-test, [ --without-appdata-test do not validate the appdata file])
have_appstream_util="no (disabled)"
if test "x$with_appdata_test" != "xno"; then
AC_PATH_PROG(APPSTREAM_UTIL, appstream-util, no)
if test "x$APPSTREAM_UTIL" != "xno"; then
have_appstream_util="yes"
else
have_appstream_util="no (appstream-util not found)"
fi
fi
AM_CONDITIONAL(HAVE_APPSTREAM_UTIL, test "x$have_appstream_util" = "xyes")
if test "x$have_appstream_util" = "xyes"; then
have_appstream_util="yes (this test requires network access; --without-appdata-test to disable)"
fi
######################################
# Checks for gtk-doc and docbook-tools
......@@ -2656,6 +2676,7 @@ Optional Modules:
Tests:
Use xvfb-run $have_xvfb_run
Test appdata $have_appstream_util
$have_recommended_xgettext$have_recommended_fontconfig$have_recommended_gtk$warning_vector_icons_windows$warning_glib_networking"
if test "x$required_deps" = "x"; then
......
......@@ -67,3 +67,8 @@ validate: gimp.desktop
fi )
dist-hook: validate
if HAVE_APPSTREAM_UTIL
TESTS_ENVIRONMENT = GIMP_TESTING_ABS_TOP_SRCDIR=@abs_top_srcdir@
TESTS = test-appdata.sh
endif
#!/bin/sh
appstream-util validate-strict ${GIMP_TESTING_ABS_TOP_SRCDIR}/desktop/gimp.appdata.xml.in
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment