From 8c0e79f8240067918891cd9f406b3ff0ee721d79 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 22 Jun 2010 09:39:02 -0400 Subject: [PATCH 1/2] Run CMake.HTML test without net access (#10857) Use xmllint's --nonet option to avoid downloading the xhtml DTD. Provide the DTD and its dependencies locally. --- Utilities/CMakeLists.txt | 10 +- Utilities/xml/xhtml-lat1.ent | 196 +++++++ Utilities/xml/xhtml-special.ent | 80 +++ Utilities/xml/xhtml-symbol.ent | 237 ++++++++ Utilities/xml/xhtml1-strict.dtd | 977 ++++++++++++++++++++++++++++++++ 5 files changed, 1499 insertions(+), 1 deletion(-) create mode 100644 Utilities/xml/xhtml-lat1.ent create mode 100644 Utilities/xml/xhtml-special.ent create mode 100644 Utilities/xml/xhtml-symbol.ent create mode 100644 Utilities/xml/xhtml1-strict.dtd diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt index ecae7b0c9..4aa87196a 100644 --- a/Utilities/CMakeLists.txt +++ b/Utilities/CMakeLists.txt @@ -138,8 +138,16 @@ if(BUILD_TESTING) endif() mark_as_advanced(LIBXML2_XMLLINT_EXECUTABLE) if(LIBXML2_XMLLINT_EXECUTABLE) + # We provide the XHTML DTD and its dependencies in the 'xml' + # directory so that xmllint can run without network access. + # However, it's --path option accepts a space-separated list of + # paths so it cannot handle spaces in the path to the source tree. + # Therefore we run the tool with the current work directory set to + # the 'xml' directory and use '.' as the path. add_test(CMake.HTML - ${LIBXML2_XMLLINT_EXECUTABLE} --valid --noout ${HTML_FILES} + ${CMAKE_CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}/xml + ${LIBXML2_XMLLINT_EXECUTABLE} --valid --noout --nonet --path . + ${HTML_FILES} ) endif() endif() diff --git a/Utilities/xml/xhtml-lat1.ent b/Utilities/xml/xhtml-lat1.ent new file mode 100644 index 000000000..ffee223eb --- /dev/null +++ b/Utilities/xml/xhtml-lat1.ent @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Utilities/xml/xhtml-special.ent b/Utilities/xml/xhtml-special.ent new file mode 100644 index 000000000..3a83fb656 --- /dev/null +++ b/Utilities/xml/xhtml-special.ent @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Utilities/xml/xhtml-symbol.ent b/Utilities/xml/xhtml-symbol.ent new file mode 100644 index 000000000..d0c77eebc --- /dev/null +++ b/Utilities/xml/xhtml-symbol.ent @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Utilities/xml/xhtml1-strict.dtd b/Utilities/xml/xhtml1-strict.dtd new file mode 100644 index 000000000..e48fbea6e --- /dev/null +++ b/Utilities/xml/xhtml1-strict.dtd @@ -0,0 +1,977 @@ + + + + + +%HTMLlat1; + + +%HTMLsymbol; + + +%HTMLspecial; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 1819d9d61794a0783c30c1b8144391e8dba2392a Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 23 Jun 2010 07:38:33 -0400 Subject: [PATCH 2/2] Run CMake.HTML test with older xmllint (#10857) Old versions of xmllint do not have --nonet or --path options. Fall back to the network-access form in this case. --- Utilities/CMakeLists.txt | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt index 4aa87196a..4c9202c47 100644 --- a/Utilities/CMakeLists.txt +++ b/Utilities/CMakeLists.txt @@ -138,16 +138,24 @@ if(BUILD_TESTING) endif() mark_as_advanced(LIBXML2_XMLLINT_EXECUTABLE) if(LIBXML2_XMLLINT_EXECUTABLE) - # We provide the XHTML DTD and its dependencies in the 'xml' - # directory so that xmllint can run without network access. - # However, it's --path option accepts a space-separated list of - # paths so it cannot handle spaces in the path to the source tree. - # Therefore we run the tool with the current work directory set to - # the 'xml' directory and use '.' as the path. - add_test(CMake.HTML - ${CMAKE_CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}/xml - ${LIBXML2_XMLLINT_EXECUTABLE} --valid --noout --nonet --path . - ${HTML_FILES} - ) + execute_process(COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --help + OUTPUT_VARIABLE _help ERROR_VARIABLE _err) + if("${_help}" MATCHES "--path" AND "${_help}" MATCHES "--nonet") + # We provide the XHTML DTD and its dependencies in the 'xml' + # directory so that xmllint can run without network access. + # However, it's --path option accepts a space-separated list of + # paths so it cannot handle spaces in the path to the source tree. + # Therefore we run the tool with the current work directory set to + # the 'xml' directory and use '.' as the path. + add_test(CMake.HTML + ${CMAKE_CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}/xml + ${LIBXML2_XMLLINT_EXECUTABLE} --valid --noout --nonet --path . + ${HTML_FILES} + ) + else() + add_test(CMake.HTML + ${LIBXML2_XMLLINT_EXECUTABLE} --valid --noout ${HTML_FILES} + ) + endif() endif() endif()