From 0f45b9bf3b8a1b8df64583159dbce0ed09c587ed Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Tue, 26 Oct 2021 23:33:39 +0200 Subject: Test the project's XMLs for well-formedness But only if the respective binaries can be found. --- CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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}) -- cgit v1.2.3-70-g09d2