diff --git a/kde-modules/KDECMakeSettings.cmake b/kde-modules/KDECMakeSettings.cmake --- a/kde-modules/KDECMakeSettings.cmake +++ b/kde-modules/KDECMakeSettings.cmake @@ -176,13 +176,24 @@ ################ Testing setup #################################### +find_program(APPSTREAMUTILCLI appstream-util) +function(appstreamutiltest) + if(APPSTREAMUTILCLI AND NOT appstreamutiltest_added) + set(appstreamutiltest_added TRUE PARENT_SCOPE) + add_test(NAME appstreamutiltest COMMAND ${CMAKE_COMMAND} -DAPPSTREAMCLI=${APPSTREAMUTILCLI} -DINSTALL_FILES=${CMAKE_BINARY_DIR}/install_manifest.txt -P ${CMAKE_CURRENT_LIST_DIR}/appstreamtest.cmake) + else() + message(STATUS "Could not set up the appstream test using appstream-util. appstream-util is missing.") + endif() +endfunction() + + find_program(APPSTREAMCLI appstreamcli) function(appstreamtest) if(APPSTREAMCLI AND NOT appstreamtest_added) set(appstreamtest_added TRUE PARENT_SCOPE) add_test(NAME appstreamtest COMMAND ${CMAKE_COMMAND} -DAPPSTREAMCLI=${APPSTREAMCLI} -DINSTALL_FILES=${CMAKE_BINARY_DIR}/install_manifest.txt -P ${CMAKE_CURRENT_LIST_DIR}/appstreamtest.cmake) else() - message(STATUS "Could not set up the appstream test. appstreamcli is missing.") + message(STATUS "Could not set up the appstream test using appstreamcli. appstreamcli is missing.") endif() endfunction() @@ -198,6 +209,7 @@ option(BUILD_TESTING "Build the testing tree." ON) if(BUILD_TESTING) enable_testing() + appstreamutiltest() appstreamtest() endif () endif () diff --git a/kde-modules/appstreamtest.cmake b/kde-modules/appstreamtest.cmake --- a/kde-modules/appstreamtest.cmake +++ b/kde-modules/appstreamtest.cmake @@ -18,7 +18,7 @@ if(metadatafiles) set(appstreamcliout "") - execute_process(COMMAND ${APPSTREAMCLI} validate ${metadatafiles} + execute_process(COMMAND ${FLATPAKCLI} run org.freedesktop.appstream-glib validate ${metadatafiles} ERROR_VARIABLE appstreamcliout OUTPUT_VARIABLE appstreamcliout RESULT_VARIABLE result