From 6273b8354902e1af124d6f9b4a0ba23cf5e8a9b9 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Fri, 8 Dec 2017 17:38:13 +0100 Subject: Autogen: Tests: Separate uicOnly test --- Tests/QtAutogen/CMakeLists.txt | 9 --------- Tests/QtAutogen/CommonTests.cmake | 3 +++ Tests/QtAutogen/UicOnly/CMakeLists.txt | 10 ++++++++++ Tests/QtAutogen/UicOnly/uiconly.cpp | 18 ++++++++++++++++++ Tests/QtAutogen/UicOnly/uiconly.h | 20 ++++++++++++++++++++ Tests/QtAutogen/UicOnly/uiconly.ui | 24 ++++++++++++++++++++++++ Tests/QtAutogen/uicOnlySource/uiconly.cpp | 18 ------------------ Tests/QtAutogen/uicOnlySource/uiconly.h | 20 -------------------- Tests/QtAutogen/uicOnlySource/uiconly.ui | 24 ------------------------ 9 files changed, 75 insertions(+), 71 deletions(-) create mode 100644 Tests/QtAutogen/UicOnly/CMakeLists.txt create mode 100644 Tests/QtAutogen/UicOnly/uiconly.cpp create mode 100644 Tests/QtAutogen/UicOnly/uiconly.h create mode 100644 Tests/QtAutogen/UicOnly/uiconly.ui delete mode 100644 Tests/QtAutogen/uicOnlySource/uiconly.cpp delete mode 100644 Tests/QtAutogen/uicOnlySource/uiconly.h delete mode 100644 Tests/QtAutogen/uicOnlySource/uiconly.ui diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 160903a..85029d1 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -60,15 +60,6 @@ if(NON_ASCII_BDIR AND WIN32) endif() # -- Test -# UIC only -if(ALLOW_WRAP_CPP) - qtx_wrap_cpp(uicOnlyMoc uicOnlySource/uiconly.h) - add_executable(uicOnly uicOnlySource/uiconly.cpp ${uicOnlyMoc}) - set_property(TARGET uicOnly PROPERTY AUTOUIC ON) - target_link_libraries(uicOnly ${QT_LIBRARIES}) -endif() - -# -- Test # RCC only add_executable(rccOnly rccOnly.cpp rccOnlyRes.qrc) set_property(TARGET rccOnly PROPERTY AUTORCC ON) diff --git a/Tests/QtAutogen/CommonTests.cmake b/Tests/QtAutogen/CommonTests.cmake index 5abbee5..9121f41 100644 --- a/Tests/QtAutogen/CommonTests.cmake +++ b/Tests/QtAutogen/CommonTests.cmake @@ -1,3 +1,6 @@ # Autogen tests common for Qt4 and Qt5 ADD_AUTOGEN_TEST(MocOnly mocOnly) ADD_AUTOGEN_TEST(MocOptions mocOptions) +if(QT_TEST_ALLOW_QT_MACROS) + ADD_AUTOGEN_TEST(UicOnly uicOnly) +endif() diff --git a/Tests/QtAutogen/UicOnly/CMakeLists.txt b/Tests/QtAutogen/UicOnly/CMakeLists.txt new file mode 100644 index 0000000..89a9a1b --- /dev/null +++ b/Tests/QtAutogen/UicOnly/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.10) +project(UicOnly) +include("../AutogenTest.cmake") + +# Test AUTOUIC being enabled only +# The moc is provided by the Qt macro +qtx_wrap_cpp(uicOnlyMoc uiconly.h) +add_executable(uicOnly uiconly.cpp ${uicOnlyMoc}) +set_property(TARGET uicOnly PROPERTY AUTOUIC ON) +target_link_libraries(uicOnly ${QT_LIBRARIES}) diff --git a/Tests/QtAutogen/UicOnly/uiconly.cpp b/Tests/QtAutogen/UicOnly/uiconly.cpp new file mode 100644 index 0000000..7b91b25 --- /dev/null +++ b/Tests/QtAutogen/UicOnly/uiconly.cpp @@ -0,0 +1,18 @@ + +#include "uiconly.h" + +UicOnly::UicOnly(QWidget* parent) + : QWidget(parent) + , ui(new Ui::UicOnly) +{ +} + +UicOnly::~UicOnly() +{ + delete ui; +} + +int main() +{ + return 0; +} diff --git a/Tests/QtAutogen/UicOnly/uiconly.h b/Tests/QtAutogen/UicOnly/uiconly.h new file mode 100644 index 0000000..8f4eebe --- /dev/null +++ b/Tests/QtAutogen/UicOnly/uiconly.h @@ -0,0 +1,20 @@ + +#ifndef UIC_ONLY_H +#define UIC_ONLY_H + +#include + +#include "ui_uiconly.h" + +class UicOnly : public QWidget +{ + Q_OBJECT +public: + explicit UicOnly(QWidget* parent = 0); + ~UicOnly(); + +private: + Ui::UicOnly* ui; +}; + +#endif diff --git a/Tests/QtAutogen/UicOnly/uiconly.ui b/Tests/QtAutogen/UicOnly/uiconly.ui new file mode 100644 index 0000000..13fb832 --- /dev/null +++ b/Tests/QtAutogen/UicOnly/uiconly.ui @@ -0,0 +1,24 @@ + + + UicOnly + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + + + + + + diff --git a/Tests/QtAutogen/uicOnlySource/uiconly.cpp b/Tests/QtAutogen/uicOnlySource/uiconly.cpp deleted file mode 100644 index 7b91b25..0000000 --- a/Tests/QtAutogen/uicOnlySource/uiconly.cpp +++ /dev/null @@ -1,18 +0,0 @@ - -#include "uiconly.h" - -UicOnly::UicOnly(QWidget* parent) - : QWidget(parent) - , ui(new Ui::UicOnly) -{ -} - -UicOnly::~UicOnly() -{ - delete ui; -} - -int main() -{ - return 0; -} diff --git a/Tests/QtAutogen/uicOnlySource/uiconly.h b/Tests/QtAutogen/uicOnlySource/uiconly.h deleted file mode 100644 index 8f4eebe..0000000 --- a/Tests/QtAutogen/uicOnlySource/uiconly.h +++ /dev/null @@ -1,20 +0,0 @@ - -#ifndef UIC_ONLY_H -#define UIC_ONLY_H - -#include - -#include "ui_uiconly.h" - -class UicOnly : public QWidget -{ - Q_OBJECT -public: - explicit UicOnly(QWidget* parent = 0); - ~UicOnly(); - -private: - Ui::UicOnly* ui; -}; - -#endif diff --git a/Tests/QtAutogen/uicOnlySource/uiconly.ui b/Tests/QtAutogen/uicOnlySource/uiconly.ui deleted file mode 100644 index 13fb832..0000000 --- a/Tests/QtAutogen/uicOnlySource/uiconly.ui +++ /dev/null @@ -1,24 +0,0 @@ - - - UicOnly - - - - 0 - 0 - 400 - 300 - - - - Form - - - - - - - - - - -- cgit v0.12