Test SVG and desktop file validity

This commit is contained in:
Přemysl Eric Janouch 2023-06-15 16:21:18 +02:00
parent 74d9acecb5
commit 951208c15b
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 10 additions and 4 deletions

View File

@ -380,14 +380,12 @@ endif ()
# Do some unit tests # Do some unit tests
option (BUILD_TESTING "Build tests" OFF) option (BUILD_TESTING "Build tests" OFF)
set (project_tests stardict)
if (BUILD_TESTING) if (BUILD_TESTING)
enable_testing () enable_testing ()
find_program (xmlwf_EXECUTABLE xmlwf) find_program (xmlwf_EXECUTABLE xmlwf)
find_program (xmllint_EXECUTABLE xmllint) find_program (xmllint_EXECUTABLE xmllint)
foreach (xml ${PROJECT_NAME}.xml) foreach (xml ${PROJECT_NAME}.xml ${PROJECT_NAME}.svg)
if (xmlwf_EXECUTABLE) if (xmlwf_EXECUTABLE)
add_test (test-xmlwf-${xml} ${xmlwf_EXECUTABLE} add_test (test-xmlwf-${xml} ${xmlwf_EXECUTABLE}
${PROJECT_SOURCE_DIR}/${xml}) ${PROJECT_SOURCE_DIR}/${xml})
@ -398,7 +396,15 @@ if (BUILD_TESTING)
endif () endif ()
endforeach () endforeach ()
foreach (name ${project_tests}) find_program (dfv_EXECUTABLE desktop-file-validate)
if (dfv_EXECUTABLE)
foreach (df ${PROJECT_NAME}.desktop)
add_test (test-dfv-${df} ${dfv_EXECUTABLE}
${PROJECT_SOURCE_DIR}/${df})
endforeach ()
endif ()
foreach (name stardict)
add_executable (test-${name} add_executable (test-${name}
src/test-${name}.c ${project_common_sources}) src/test-${name}.c ${project_common_sources})
target_link_libraries (test-${name} ${project_common_libraries}) target_link_libraries (test-${name} ${project_common_libraries})