desktop: use appstreamcli for testing instead of appstream-util.

As told to us, this is the reference AppStream file testing tool, and it
understands more of the spec.

Also since commit 73e2e701da, appstream-util chokes on newer url types
from the spec. These tags are now supported both in appstream-util and
appstreamcli source code, except that appstreamcli had release 0.15.3,
available in Debian testing, whereas there were apparently no recent
appstream-glib/util release (and none since 2020). So for these various
reasons, let's go with the appstreamcli tool.

The only downside is that appstream package (where appstreamcli lives)
is not available on MSYS2, but since it's only an optional test tool for
XML files which should be common on all platforms, it's probably
acceptable.
This commit is contained in:
Jehan 2022-05-03 21:48:28 +02:00
parent 89fc542fad
commit 73f1f944c5
4 changed files with 20 additions and 20 deletions

View File

@ -2656,24 +2656,24 @@ if test "x$with_xvfb_run" != "xno"; then
fi
AM_CONDITIONAL(HAVE_XVFB_RUN, test "x$have_xvfb_run" = "xyes")
##########################
# Check for appstream-util
##########################
########################
# Check for appstreamcli
########################
AC_ARG_WITH(appdata-test, [ --without-appdata-test do not validate the appdata file])
have_appstream_util="no (disabled)"
have_appstreamcli="no (disabled)"
if test "x$with_appdata_test" != "xno"; then
AC_PATH_PROG(APPSTREAM_UTIL, appstream-util, no)
AC_PATH_PROG(APPSTREAM_UTIL, appstreamcli, no)
if test "x$APPSTREAM_UTIL" != "xno"; then
have_appstream_util="yes"
have_appstreamcli="yes"
else
have_appstream_util="no (appstream-util not found)"
have_appstreamcli="no (appstreamcli 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)"
AM_CONDITIONAL(HAVE_APPSTREAM_UTIL, test "x$have_appstreamcli" = "xyes")
if test "x$have_appstreamcli" = "xyes"; then
have_appstreamcli="yes (this test requires network access; --without-appdata-test to disable)"
fi
@ -3321,7 +3321,7 @@ Optional Modules:
Tests:
Use xvfb-run $have_xvfb_run
Test appdata $have_appstream_util
Test appdata $have_appstreamcli
Test desktop file $have_desktop_file_validate
Documentation:

View File

@ -101,10 +101,10 @@ if desktop_validate.found()
)
endif
if appstream_util.found()
if appstreamcli.found()
test('appdata_file',
appstream_util,
args: [ 'validate-relax', appdatafile ],
appstreamcli,
args: [ 'validate', appdatafile ],
env: [
'GIMP_TESTING_ABS_TOP_BUILDDIR=' + meson.build_root(),
],
@ -112,8 +112,8 @@ if appstream_util.found()
)
test('metainfo_file',
appstream_util,
args: [ 'validate-relax', metainfofile ],
appstreamcli,
args: [ 'validate', metainfofile ],
env: [
'GIMP_TESTING_ABS_TOP_BUILDDIR=' + meson.build_root(),
],

View File

@ -2,8 +2,8 @@
# TODO: use validate-strict when the last errors for a strict validation
# are fixed.
appstream-util validate-relax ${GIMP_TESTING_ABS_TOP_BUILDDIR}/desktop/org.gimp.GIMP.appdata.xml && \
appstream-util validate-relax ${GIMP_TESTING_ABS_TOP_BUILDDIR}/desktop/gimp-data-extras.metainfo.xml && \
appstreamcli validate ${GIMP_TESTING_ABS_TOP_BUILDDIR}/desktop/org.gimp.GIMP.appdata.xml && \
appstreamcli validate ${GIMP_TESTING_ABS_TOP_BUILDDIR}/desktop/gimp-data-extras.metainfo.xml && \
if [ $(expr @GIMP_MICRO_VERSION@ % 2) = 0 ]; then
grep TODO ${GIMP_TESTING_ABS_TOP_BUILDDIR}/desktop/org.gimp.GIMP.appdata.xml
if [ $? = 0 ]; then

View File

@ -1020,7 +1020,7 @@ xsltproc = find_program('xsltproc')
intltool_merge = find_program('intltool-merge')
desktop_validate = find_program('desktop-file-validate', required: false)
appstream_util = find_program('appstream-util', required: get_option('appdata-test'))
appstreamcli = find_program('appstreamcli', required: get_option('appdata-test'))
# Check for doc generation tools
@ -1863,7 +1863,7 @@ final_message = [
'',
'''Tests:''',
''' Use xvfb-run @0@'''.format(xvfb_run.found()),
''' Test appdata @0@'''.format(appstream_util.found()),
''' Test appdata @0@'''.format(appstreamcli.found()),
'',
'''Documentation:''',
''' libgimp API Reference: @0@'''.format(gi_docgen.found()),