aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-10-26 23:33:39 +0200
committerPřemysl Eric Janouch <p@janouch.name>2021-10-26 23:34:04 +0200
commit0f45b9bf3b8a1b8df64583159dbce0ed09c587ed (patch)
tree49284fb1aa533bc3d1133a7a8bf12d14f0336352 /CMakeLists.txt
parent27a9869a6a68a2898e08b7c977941b6781788ecb (diff)
downloadtdv-0f45b9bf3b8a1b8df64583159dbce0ed09c587ed.tar.gz
tdv-0f45b9bf3b8a1b8df64583159dbce0ed09c587ed.tar.xz
tdv-0f45b9bf3b8a1b8df64583159dbce0ed09c587ed.zip
Test the project's XMLs for well-formedness
But only if the respective binaries can be found.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8505abe..46c2cbc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -276,6 +276,19 @@ set (project_tests stardict)
if (BUILD_TESTING)
enable_testing ()
+ find_program (xmlwf_EXECUTABLE xmlwf)
+ find_program (xmllint_EXECUTABLE xmllint)
+ foreach (xml sdgui.xml)
+ if (xmlwf_EXECUTABLE)
+ add_test (test-xmlwf-${xml} ${xmlwf_EXECUTABLE}
+ ${PROJECT_SOURCE_DIR}/${xml})
+ endif ()
+ if (xmllint_EXECUTABLE)
+ add_test (test-xmllint-${xml} ${xmllint_EXECUTABLE} --noout
+ ${PROJECT_SOURCE_DIR}/${xml})
+ endif ()
+ endforeach ()
+
foreach (name ${project_tests})
add_executable (test-${name}
src/test-${name}.c ${project_common_sources})