From f863bf7d6452740e131e3e846922d57cab2173f6 Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Wed, 9 Oct 2019 16:54:42 +0200 Subject: Add XML tests Initial conversion of XML tests. Change-Id: I47256d4d87dad106b04be2c2e1abc9ef070be973 Reviewed-by: Alexandru Croitor --- tests/auto/CMakeLists.txt | 2 +- tests/auto/xml/CMakeLists.txt | 4 ++++ tests/auto/xml/dom/CMakeLists.txt | 3 +++ tests/auto/xml/dom/qdom/CMakeLists.txt | 21 +++++++++++++++++ tests/auto/xml/sax/CMakeLists.txt | 7 ++++++ tests/auto/xml/sax/qxml/CMakeLists.txt | 16 +++++++++++++ tests/auto/xml/sax/qxmlinputsource/CMakeLists.txt | 13 +++++++++++ tests/auto/xml/sax/qxmlsimplereader/CMakeLists.txt | 27 ++++++++++++++++++++++ .../xml/sax/qxmlsimplereader/parser/CMakeLists.txt | 19 +++++++++++++++ 9 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 tests/auto/xml/CMakeLists.txt create mode 100644 tests/auto/xml/dom/CMakeLists.txt create mode 100644 tests/auto/xml/dom/qdom/CMakeLists.txt create mode 100644 tests/auto/xml/sax/CMakeLists.txt create mode 100644 tests/auto/xml/sax/qxml/CMakeLists.txt create mode 100644 tests/auto/xml/sax/qxmlinputsource/CMakeLists.txt create mode 100644 tests/auto/xml/sax/qxmlsimplereader/CMakeLists.txt create mode 100644 tests/auto/xml/sax/qxmlsimplereader/parser/CMakeLists.txt (limited to 'tests') diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index 1c73f4c8ef..202370bd0a 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -39,7 +39,7 @@ if (NOT CMAKE_CROSSCOMPILE AND QT_FEATURE_process) add_subdirectory(tools) endif() if (TARGET Qt::Xml) -# add_subdirectory(xml) + add_subdirectory(xml) endif() if (TARGET Qt::Concurrent) add_subdirectory(concurrent) diff --git a/tests/auto/xml/CMakeLists.txt b/tests/auto/xml/CMakeLists.txt new file mode 100644 index 0000000000..703cba344d --- /dev/null +++ b/tests/auto/xml/CMakeLists.txt @@ -0,0 +1,4 @@ +# Generated from xml.pro. + +add_subdirectory(dom) +add_subdirectory(sax) diff --git a/tests/auto/xml/dom/CMakeLists.txt b/tests/auto/xml/dom/CMakeLists.txt new file mode 100644 index 0000000000..08a7621e88 --- /dev/null +++ b/tests/auto/xml/dom/CMakeLists.txt @@ -0,0 +1,3 @@ +# Generated from dom.pro. + +add_subdirectory(qdom) diff --git a/tests/auto/xml/dom/qdom/CMakeLists.txt b/tests/auto/xml/dom/qdom/CMakeLists.txt new file mode 100644 index 0000000000..be70ec08cc --- /dev/null +++ b/tests/auto/xml/dom/qdom/CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from qdom.pro. + +##################################################################### +## tst_qdom Test: +##################################################################### + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + testdata/*) +list(APPEND test_data ${test_data_glob}) +list(APPEND test_data "doubleNamespaces.xml") +list(APPEND test_data "umlaut.xml") + +add_qt_test(tst_qdom + SOURCES + tst_qdom.cpp + PUBLIC_LIBRARIES + Qt::Xml + TESTDATA ${test_data} +) diff --git a/tests/auto/xml/sax/CMakeLists.txt b/tests/auto/xml/sax/CMakeLists.txt new file mode 100644 index 0000000000..dd826d5e4f --- /dev/null +++ b/tests/auto/xml/sax/CMakeLists.txt @@ -0,0 +1,7 @@ +# Generated from sax.pro. + +add_subdirectory(qxml) +if(TARGET Qt::Network) + add_subdirectory(qxmlinputsource) + add_subdirectory(qxmlsimplereader) +endif() diff --git a/tests/auto/xml/sax/qxml/CMakeLists.txt b/tests/auto/xml/sax/qxml/CMakeLists.txt new file mode 100644 index 0000000000..bfbf7fe979 --- /dev/null +++ b/tests/auto/xml/sax/qxml/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from qxml.pro. + +##################################################################### +## tst_qxml Test: +##################################################################### + +# Collect test data +list(APPEND test_data "0x010D.xml") + +add_qt_test(tst_qxml + SOURCES + tst_qxml.cpp + PUBLIC_LIBRARIES + Qt::Xml + TESTDATA ${test_data} +) diff --git a/tests/auto/xml/sax/qxmlinputsource/CMakeLists.txt b/tests/auto/xml/sax/qxmlinputsource/CMakeLists.txt new file mode 100644 index 0000000000..48ba5f6e3f --- /dev/null +++ b/tests/auto/xml/sax/qxmlinputsource/CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from qxmlinputsource.pro. + +##################################################################### +## tst_qxmlinputsource Test: +##################################################################### + +add_qt_test(tst_qxmlinputsource + SOURCES + tst_qxmlinputsource.cpp + PUBLIC_LIBRARIES + Qt::Network + Qt::Xml +) diff --git a/tests/auto/xml/sax/qxmlsimplereader/CMakeLists.txt b/tests/auto/xml/sax/qxmlsimplereader/CMakeLists.txt new file mode 100644 index 0000000000..19fa0a002f --- /dev/null +++ b/tests/auto/xml/sax/qxmlsimplereader/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from qxmlsimplereader.pro. + +##################################################################### +## tst_qxmlsimplereader Test: +##################################################################### + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + encodings/*) +list(APPEND test_data ${test_data_glob}) +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + xmldocs/*) +list(APPEND test_data ${test_data_glob}) + +add_qt_test(tst_qxmlsimplereader + SOURCES + parser/parser.cpp parser/parser.h + tst_qxmlsimplereader.cpp + INCLUDE_DIRECTORIES + parser + PUBLIC_LIBRARIES + Qt::Network + Qt::Xml + TESTDATA ${test_data} +) diff --git a/tests/auto/xml/sax/qxmlsimplereader/parser/CMakeLists.txt b/tests/auto/xml/sax/qxmlsimplereader/parser/CMakeLists.txt new file mode 100644 index 0000000000..6ffb17ac0f --- /dev/null +++ b/tests/auto/xml/sax/qxmlsimplereader/parser/CMakeLists.txt @@ -0,0 +1,19 @@ +# special case skip regeneration + +cmake_minimum_required(VERSION 3.14.0) + +project(Parser CXX) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Xml) + +add_executable(parser) + +target_sources(parser PRIVATE + main.cpp + parser.cpp + parser.h +) + +target_link_libraries(parser PRIVATE + Qt::Gui + Qt::Xml +) -- cgit v1.2.3