summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2018-05-12 09:24:33 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2018-05-16 07:11:45 (GMT)
commit3715d0fbcfd4ca06de961421f5bc1283d5c58444 (patch)
tree2406a8266e3dcb42dbbb740f83539a7dbc5535fc /Tests
parentc698dbd45d0f51b5b13d728a2216308c6a11478e (diff)
downloadCMake-3715d0fbcfd4ca06de961421f5bc1283d5c58444.zip
CMake-3715d0fbcfd4ca06de961421f5bc1283d5c58444.tar.gz
CMake-3715d0fbcfd4ca06de961421f5bc1283d5c58444.tar.bz2
Tests: Add QtAutogen test for a low cmake_minimum_required version
Diffstat (limited to 'Tests')
-rw-r--r--Tests/QtAutogen/CommonTests.cmake3
-rw-r--r--Tests/QtAutogen/LowMinimumVersion/CMakeLists.txt16
-rw-r--r--Tests/QtAutogen/LowMinimumVersion/example.qrc5
-rw-r--r--Tests/QtAutogen/LowMinimumVersion/item.cpp19
-rw-r--r--Tests/QtAutogen/LowMinimumVersion/item.hpp15
-rw-r--r--Tests/QtAutogen/LowMinimumVersion/main.cpp10
-rw-r--r--Tests/QtAutogen/LowMinimumVersion/someText.txt1
-rw-r--r--Tests/QtAutogen/LowMinimumVersion/view.ui24
8 files changed, 92 insertions, 1 deletions
diff --git a/Tests/QtAutogen/CommonTests.cmake b/Tests/QtAutogen/CommonTests.cmake
index 094a755..982a296 100644
--- a/Tests/QtAutogen/CommonTests.cmake
+++ b/Tests/QtAutogen/CommonTests.cmake
@@ -1,4 +1,6 @@
# Autogen tests common for Qt4 and Qt5
+ADD_AUTOGEN_TEST(Complex QtAutogen)
+ADD_AUTOGEN_TEST(LowMinimumVersion lowMinimumVersion)
ADD_AUTOGEN_TEST(MocOnly mocOnly)
ADD_AUTOGEN_TEST(MocOptions mocOptions)
ADD_AUTOGEN_TEST(UicOnly uicOnly)
@@ -35,7 +37,6 @@ ADD_AUTOGEN_TEST(Parallel4 parallel4)
ADD_AUTOGEN_TEST(ParallelAUTO parallelAUTO)
ADD_AUTOGEN_TEST(SameName sameName)
ADD_AUTOGEN_TEST(StaticLibraryCycle slc)
-ADD_AUTOGEN_TEST(Complex QtAutogen)
# Rerun tests
ADD_AUTOGEN_TEST(RerunMocBasic)
if(NOT QT_TEST_VERSION STREQUAL 4)
diff --git a/Tests/QtAutogen/LowMinimumVersion/CMakeLists.txt b/Tests/QtAutogen/LowMinimumVersion/CMakeLists.txt
new file mode 100644
index 0000000..a6ac338
--- /dev/null
+++ b/Tests/QtAutogen/LowMinimumVersion/CMakeLists.txt
@@ -0,0 +1,16 @@
+# Use a low minimum version
+cmake_minimum_required(VERSION 3.0)
+project(LowMinimumVersion)
+include("../AutogenTest.cmake")
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+set(CMAKE_AUTORCC ON)
+add_executable(lowMinimumVersion
+ main.cpp
+ item.hpp
+ item.cpp
+ view.ui
+ someText.txt
+ example.qrc)
+target_link_libraries(lowMinimumVersion ${QT_QTCORE_TARGET})
diff --git a/Tests/QtAutogen/LowMinimumVersion/example.qrc b/Tests/QtAutogen/LowMinimumVersion/example.qrc
new file mode 100644
index 0000000..551ecc8
--- /dev/null
+++ b/Tests/QtAutogen/LowMinimumVersion/example.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="Example">
+ <file>someText.txt</file>
+ </qresource>
+</RCC>
diff --git a/Tests/QtAutogen/LowMinimumVersion/item.cpp b/Tests/QtAutogen/LowMinimumVersion/item.cpp
new file mode 100644
index 0000000..e2f19b2
--- /dev/null
+++ b/Tests/QtAutogen/LowMinimumVersion/item.cpp
@@ -0,0 +1,19 @@
+#include "item.hpp"
+#include <ui_view.h>
+
+class MocLocal : public QObject
+{
+ Q_OBJECT;
+
+public:
+ MocLocal() = default;
+ ~MocLocal() = default;
+};
+
+void Item::go()
+{
+ Ui_View ui;
+ MocLocal obj;
+}
+
+#include "item.moc"
diff --git a/Tests/QtAutogen/LowMinimumVersion/item.hpp b/Tests/QtAutogen/LowMinimumVersion/item.hpp
new file mode 100644
index 0000000..01255d4
--- /dev/null
+++ b/Tests/QtAutogen/LowMinimumVersion/item.hpp
@@ -0,0 +1,15 @@
+#ifndef ITEM_HPP
+#define ITEM_HPP
+
+#include <QObject>
+
+class Item : public QObject
+{
+ Q_OBJECT
+
+public:
+ Q_SLOT
+ void go();
+};
+
+#endif
diff --git a/Tests/QtAutogen/LowMinimumVersion/main.cpp b/Tests/QtAutogen/LowMinimumVersion/main.cpp
new file mode 100644
index 0000000..9f225a4
--- /dev/null
+++ b/Tests/QtAutogen/LowMinimumVersion/main.cpp
@@ -0,0 +1,10 @@
+#include "item.hpp"
+
+int main(int argc, char* argv[])
+{
+ Q_INIT_RESOURCE(example);
+ Item item;
+ item.go();
+
+ return 0;
+}
diff --git a/Tests/QtAutogen/LowMinimumVersion/someText.txt b/Tests/QtAutogen/LowMinimumVersion/someText.txt
new file mode 100644
index 0000000..750dae3
--- /dev/null
+++ b/Tests/QtAutogen/LowMinimumVersion/someText.txt
@@ -0,0 +1 @@
+Hello world, you're an interesting place.
diff --git a/Tests/QtAutogen/LowMinimumVersion/view.ui b/Tests/QtAutogen/LowMinimumVersion/view.ui
new file mode 100644
index 0000000..2ffe734
--- /dev/null
+++ b/Tests/QtAutogen/LowMinimumVersion/view.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>View</class>
+ <widget class="QWidget" name="Base">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QTreeView" name="treeView"/>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>