[gimp] desktop: add a desktop file test with `desktop-file-validate` utils.



commit 660926eb3d7a1b6f52c3badf890401c49b54c02f
Author: Jehan <jehan girinstud io>
Date:   Sun May 13 15:57:28 2018 +0200

    desktop: add a desktop file test with `desktop-file-validate` utils.

 configure.ac            |   14 ++++++++++++++
 desktop/Makefile.am     |   10 ++++++++--
 desktop/test-desktop.sh |    3 +++
 3 files changed, 25 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index bfc9be5..7a8cfb8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2300,6 +2300,19 @@ if test "x$have_appstream_util" = "xyes"; then
 fi
 
 
+#################################
+# Check for desktop-file-validate
+#################################
+
+AC_PATH_PROG(DESKTOP_FILE_VALIDATE, desktop-file-validate, no)
+if test "x$APPSTREAM_UTIL" != "xno"; then
+  have_desktop_file_validate="yes"
+else
+  have_desktop_file_validate="no (desktop-file-validate not found)"
+fi
+AM_CONDITIONAL(HAVE_DESKTOP_FILE_VALIDATE, test "x$DESKTOP_FILE_VALIDATE" != "xno")
+
+
 ######################################
 # Checks for gtk-doc and docbook-tools
 ######################################
@@ -2815,6 +2828,7 @@ Optional Modules:
 Tests:
   Use xvfb-run             $have_xvfb_run
   Test appdata             $have_appstream_util
+  Test desktop file        $have_desktop_file_validate
 
$have_recommended_xgettext$have_recommended_gtk$warning_vector_icons_windows$warning_glib_networking$warning_gcc"
 
 if test "x$required_deps" = "x"; then
diff --git a/desktop/Makefile.am b/desktop/Makefile.am
index d69330a..306d52c 100644
--- a/desktop/Makefile.am
+++ b/desktop/Makefile.am
@@ -74,7 +74,13 @@ validate: gimp.desktop
 
 dist-hook: validate
 
-if HAVE_APPSTREAM_UTIL
 TESTS_ENVIRONMENT = GIMP_TESTING_ABS_TOP_BUILDDIR=@abs_top_builddir@
-TESTS = test-appdata.sh
+TESTS =
+
+if HAVE_APPSTREAM_UTIL
+TESTS += test-appdata.sh
+endif
+
+if HAVE_APPSTREAM_UTIL
+TESTS += test-desktop.sh
 endif
diff --git a/desktop/test-desktop.sh b/desktop/test-desktop.sh
new file mode 100755
index 0000000..6794034
--- /dev/null
+++ b/desktop/test-desktop.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+desktop-file-validate ${GIMP_TESTING_ABS_TOP_BUILDDIR}/desktop/gimp.desktop


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