diff --git a/desktop/meson.build b/desktop/meson.build index bee2e93c48..a493d35f2f 100644 --- a/desktop/meson.build +++ b/desktop/meson.build @@ -45,13 +45,11 @@ if desktop_validate.found() endif if appstreamcli.found() - # TODO: should we use validate-strict when the last errors for a strict - # validation are fixed? test('appdata_file', - appstreamcli, - args: [ 'validate', appdatafile ], + find_program('test-appdata.sh', required: true, dirs: [meson.current_source_dir()]), env: [ - 'GIMP_TESTING_ABS_TOP_BUILDDIR=' + meson.project_build_root(), + 'GIMP_TESTING_BUILDDIR=' + meson.current_build_dir(), + 'GIMP_RELEASE=' + (release ? '1' : '0'), ], suite: 'desktop', ) diff --git a/desktop/test-appdata.sh b/desktop/test-appdata.sh new file mode 100755 index 0000000000..6a77a10f92 --- /dev/null +++ b/desktop/test-appdata.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +cd $GIMP_TESTING_BUILDDIR +if [ $GIMP_RELEASE -eq 1 ]; then + appstreamcli validate org.gimp.GIMP.appdata.xml + exit $? +else + APPDATA=`mktemp org.gimp.GIMP.appdata.XXX.xml` + sed "s/date=\"TODO\"/date=\"`date --iso-8601`\"/" org.gimp.GIMP.appdata.xml > $APPDATA + appstreamcli validate $APPDATA + success=$? + rm $APPDATA + exit $success +fi