From 951208c15b5d92c330d890436ab26ffa478c5e27 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Thu, 15 Jun 2023 16:21:18 +0200 Subject: Test SVG and desktop file validity --- CMakeLists.txt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f995dd4..f871ea7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -380,14 +380,12 @@ endif () # Do some unit tests option (BUILD_TESTING "Build tests" OFF) -set (project_tests stardict) - if (BUILD_TESTING) enable_testing () find_program (xmlwf_EXECUTABLE xmlwf) find_program (xmllint_EXECUTABLE xmllint) - foreach (xml ${PROJECT_NAME}.xml) + foreach (xml ${PROJECT_NAME}.xml ${PROJECT_NAME}.svg) if (xmlwf_EXECUTABLE) add_test (test-xmlwf-${xml} ${xmlwf_EXECUTABLE} ${PROJECT_SOURCE_DIR}/${xml}) @@ -398,7 +396,15 @@ if (BUILD_TESTING) endif () 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} src/test-${name}.c ${project_common_sources}) target_link_libraries (test-${name} ${project_common_libraries}) -- cgit v1.2.3-70-g09d2