From 1b1248d7cd2c5dc690afc356df29d41fde2ff117 Mon Sep 17 00:00:00 2001 From: Ville Voutilainen Date: Mon, 9 Sep 2019 09:08:43 +0300 Subject: [PATCH] cmake: Enable building more of the tools tests This is incomplete. moc has compilation problems, some advanced parts of qmake tests are not supported by the converter. Change-Id: Ic389ddfa10a7558f21cf7ba9ead8e58157c760da Reviewed-by: Alexandru Croitor --- tests/auto/CMakeLists.txt | 2 +- tests/auto/tools/CMakeLists.txt | 13 ++++++++ tests/auto/tools/qdbuscpp2xml/CMakeLists.txt | 27 +++++++++++++++ tests/auto/tools/qmake/CMakeLists.txt | 31 +++++++++++++++++ tests/auto/tools/qmakelib/CMakeLists.txt | 35 ++++++++++++++++++++ 5 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 tests/auto/tools/CMakeLists.txt create mode 100644 tests/auto/tools/qdbuscpp2xml/CMakeLists.txt create mode 100644 tests/auto/tools/qmake/CMakeLists.txt create mode 100644 tests/auto/tools/qmakelib/CMakeLists.txt diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index 77ab4ea23a..1c73f4c8ef 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -36,7 +36,7 @@ if (TARGET Qt::Sql) endif() add_subdirectory(testlib) if (NOT CMAKE_CROSSCOMPILE AND QT_FEATURE_process) -# add_subdirectory(tools) + add_subdirectory(tools) endif() if (TARGET Qt::Xml) # add_subdirectory(xml) diff --git a/tests/auto/tools/CMakeLists.txt b/tests/auto/tools/CMakeLists.txt new file mode 100644 index 0000000000..c546da967f --- /dev/null +++ b/tests/auto/tools/CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from tools.pro. + +add_subdirectory(qmakelib) +add_subdirectory(qmake) +#add_subdirectory(moc) +#add_subdirectory(rcc) +if(TARGET Qt::Widgets) + add_subdirectory(uic) +endif() +if(TARGET Qt::DBus) + add_subdirectory(qdbuscpp2xml) + add_subdirectory(qdbusxml2cpp) +endif() diff --git a/tests/auto/tools/qdbuscpp2xml/CMakeLists.txt b/tests/auto/tools/qdbuscpp2xml/CMakeLists.txt new file mode 100644 index 0000000000..85483ec9dd --- /dev/null +++ b/tests/auto/tools/qdbuscpp2xml/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from qdbuscpp2xml.pro. + +##################################################################### +## tst_qdbuscpp2xml Test: +##################################################################### + +add_qt_test(tst_qdbuscpp2xml + GUI + SOURCES + test1.h + tst_qdbuscpp2xml.cpp + PUBLIC_LIBRARIES + Qt::DBus +) + +# Resources: +set(qdbuscpp2xml_resource_files + "test1.h" +) + +add_qt_resource(tst_qdbuscpp2xml "qdbuscpp2xml" + PREFIX + "/tst_qdbuscpp2xml/" + FILES + ${qdbuscpp2xml_resource_files} +) + diff --git a/tests/auto/tools/qmake/CMakeLists.txt b/tests/auto/tools/qmake/CMakeLists.txt new file mode 100644 index 0000000000..23b81fe9f5 --- /dev/null +++ b/tests/auto/tools/qmake/CMakeLists.txt @@ -0,0 +1,31 @@ +# Generated from qmake.pro. + +##################################################################### +## tst_qmake Test: +##################################################################### + +# Collect test data + +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + "testdata/*") +list(APPEND test_data ${test_data_glob}) + +add_qt_test(tst_qmake + GUI + SOURCES + testcompiler.cpp testcompiler.h + tst_qmake.cpp + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:qmake.pro:WIN32: +# testcase.timeout = "900" + +extend_target(tst_qmake CONDITION (CMAKE_CROSSCOMPILING) # special case + DEFINES + QMAKE_CROSS_COMPILED +) diff --git a/tests/auto/tools/qmakelib/CMakeLists.txt b/tests/auto/tools/qmakelib/CMakeLists.txt new file mode 100644 index 0000000000..4a07a2b477 --- /dev/null +++ b/tests/auto/tools/qmakelib/CMakeLists.txt @@ -0,0 +1,35 @@ +# Generated from qmakelib.pro. + +##################################################################### +## tst_qmakelib Test: +##################################################################### + +add_qt_test(tst_qmakelib + GUI + SOURCES + ../../../../qmake/library/ioutils.cpp + ../../../../qmake/library/proitems.cpp + ../../../../qmake/library/qmakebuiltins.cpp + ../../../../qmake/library/qmakeevaluator.cpp + ../../../../qmake/library/qmakeglobals.cpp + ../../../../qmake/library/qmakeparser.cpp + ../../../../qmake/library/qmakevfs.cpp + ../../../../qmake/library/registry.cpp + evaltest.cpp + parsertest.cpp + tst_qmakelib.cpp tst_qmakelib.h + DEFINES + PROEVALUATOR_FULL + PROEVALUATOR_SETENV + PROPARSER_DEBUG + INCLUDE_DIRECTORIES + ../../../../qmake/library +) + +## Scopes: +##################################################################### + +extend_target(tst_qmakelib CONDITION WIN32 + PUBLIC_LIBRARIES + advapi32 +)