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



commit 7e25248f3c58c4b4bdb0097702b13bc7f5833df5
Author: Jehan <jehan girinstud io>
Date:   Tue May 23 17:39:16 2017 +0200

    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).

 configure.ac            |   21 +++++++++++++++++++++
 desktop/Makefile.am     |    5 +++++
 desktop/test-appdata.sh |    3 +++
 3 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e17d5fb..214886c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
diff --git a/desktop/Makefile.am b/desktop/Makefile.am
index 3fe1e5a..00b35fe 100644
--- a/desktop/Makefile.am
+++ b/desktop/Makefile.am
@@ -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
diff --git a/desktop/test-appdata.sh b/desktop/test-appdata.sh
new file mode 100755
index 0000000..e263b70
--- /dev/null
+++ b/desktop/test-appdata.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+appstream-util validate-strict ${GIMP_TESTING_ABS_TOP_SRCDIR}/desktop/gimp.appdata.xml.in


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]