From 660926eb3d7a1b6f52c3badf890401c49b54c02f Mon Sep 17 00:00:00 2001 From: Jehan Date: Sun, 13 May 2018 15:57:28 +0200 Subject: [PATCH] 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(-) create mode 100755 desktop/test-desktop.sh diff --git a/configure.ac b/configure.ac index bfc9be5e38..7a8cfb8c53 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 d69330a528..306d52cc38 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 0000000000..6794034d8e --- /dev/null +++ b/desktop/test-desktop.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +desktop-file-validate ${GIMP_TESTING_ABS_TOP_BUILDDIR}/desktop/gimp.desktop