summaryrefslogtreecommitdiff
path: root/Utilities/CMakeLists.txt
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2010-11-02 10:41:11 -0400
committerDavid Cole <david.cole@kitware.com>2010-11-02 10:41:11 -0400
commitbb1df1ec8ea880c9859845b85828b8b724abb1ba (patch)
treebf1a1c6c34801a46ec8073e15e8745e3244b13cf /Utilities/CMakeLists.txt
parentaa350314db06da703b40c0c095a6212d3bab2e68 (diff)
downloadcmake-bb1df1ec8ea880c9859845b85828b8b724abb1ba.tar.gz
Make HTML test fail when --nonet arg is not available.
Also, emit "xmllint" and "xmllint --version" output before failing so that we can inspect the output from all the dashboard machines in CDash test results.
Diffstat (limited to 'Utilities/CMakeLists.txt')
-rw-r--r--Utilities/CMakeLists.txt30
1 files changed, 27 insertions, 3 deletions
diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt
index 4c9202c47e..e1c8827769 100644
--- a/Utilities/CMakeLists.txt
+++ b/Utilities/CMakeLists.txt
@@ -153,9 +153,33 @@ if(BUILD_TESTING)
${HTML_FILES}
)
else()
- add_test(CMake.HTML
- ${LIBXML2_XMLLINT_EXECUTABLE} --valid --noout ${HTML_FILES}
- )
+ # Intentionally committing this chunk of code for one night's run on the
+ # Nightly dashboard suite. This will help us identify all machines with
+ # older versions of xmllint installed. (This should match the set of
+ # machines where this test is failing at the moment anyhow...)
+ #
+ # After we identify all of them, we can decide whether to simply make
+ # this else block empty, skipping the test, or whether there should be
+ # some alternative equivalent test on such machines...
+ #
+ set(script "${CMAKE_CURRENT_BINARY_DIR}/CMake.HTML.cmake")
+
+ set(text "Intentionally fail when xmllint has no --nonet arg.")
+ set(text "${text} The CMake test suite should avoid network activity")
+ set(text "${text} when possible.")
+
+ if(NOT EXISTS "${script}.in")
+ file(WRITE "${script}.in" "execute_process(COMMAND
+ \"${LIBXML2_XMLLINT_EXECUTABLE}\" OUTPUT_VARIABLE noargs)
+message(\"\${noargs}\")
+execute_process(COMMAND
+ \"${LIBXML2_XMLLINT_EXECUTABLE}\" --version OUTPUT_VARIABLE version)
+message(\"\${version}\")
+message(FATAL_ERROR \"${text}\")
+")
+ endif()
+ configure_file("${script}.in" "${script}" @ONLY)
+ add_test(CMake.HTML ${CMAKE_CMAKE_COMMAND} -P ${script})
endif()
endif()
endif()