Fix enabling AppStream tests

This commit is contained in:
Martchus 2023-11-30 19:44:08 +01:00
parent 9d8f897972
commit 35f56d486c
1 changed files with 6 additions and 4 deletions

View File

@ -86,10 +86,12 @@ function (add_appstream_file)
set(APPSTREAM_TESTS_ENABLED_DEFAULT ON) set(APPSTREAM_TESTS_ENABLED_DEFAULT ON)
endif () endif ()
option(APPSTREAM_TESTS_ENABLED "enables tests for checking whether AppStream files" "${APPSTREAM_TESTS_ENABLED_DEFAULT}") option(APPSTREAM_TESTS_ENABLED "enables tests for checking whether AppStream files" "${APPSTREAM_TESTS_ENABLED_DEFAULT}")
if (NOT APPSTREAMCLI_BIN) if (APPSTREAM_TESTS_ENABLED)
message(FATAL_ERROR "Unable to validate appstreamcli files; appstreamcli not found") if (NOT APPSTREAMCLI_BIN)
else () message(FATAL_ERROR "Unable to validate appstreamcli files; appstreamcli not found")
add_test(NAME "${META_TARGET_NAME}_appstream_validation" COMMAND "${APPSTREAMCLI_BIN}" validate "${APPSTREAM_FILE}") else ()
add_test(NAME "${META_TARGET_NAME}_appstream_validation" COMMAND "${APPSTREAMCLI_BIN}" validate "${APPSTREAM_FILE}")
endif ()
endif () endif ()
endfunction () endfunction ()