summaryrefslogtreecommitdiffstats
path: root/Tests/QtAutogen
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/QtAutogen')
-rw-r--r--Tests/QtAutogen/Complex/codeeditor.cpp5
-rw-r--r--Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt4
-rw-r--r--Tests/QtAutogen/Tests.cmake1
-rw-r--r--Tests/QtAutogen/UnityMocSource/CMakeLists.txt12
-rw-r--r--Tests/QtAutogen/UnityMocSource/library.cpp6
-rw-r--r--Tests/QtAutogen/UnityMocSource/main.cpp4
6 files changed, 29 insertions, 3 deletions
diff --git a/Tests/QtAutogen/Complex/codeeditor.cpp b/Tests/QtAutogen/Complex/codeeditor.cpp
index bb6f405..80d6a55 100644
--- a/Tests/QtAutogen/Complex/codeeditor.cpp
+++ b/Tests/QtAutogen/Complex/codeeditor.cpp
@@ -40,7 +40,10 @@
#include "codeeditor.h"
-#include <QtGui>
+#include <QPainter>
+#include <QSize>
+#include <QTextBlock>
+#include <QWidget>
CodeEditor::CodeEditor(QWidget* parent)
: QPlainTextEdit(parent)
diff --git a/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt b/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt
index e1951f1..a7fb2d7 100644
--- a/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt
@@ -104,7 +104,7 @@ require_change_not(B)
require_change(C)
require_change(D)
# There's a bug in Ninja on Windows:
-# https://gitlab.kitware.com/cmake/cmake/issues/16776
+# https://gitlab.kitware.com/cmake/cmake/-/issues/16776
if(NOT ("${CMAKE_GENERATOR}" MATCHES "Ninja"))
require_change(E)
endif()
@@ -128,7 +128,7 @@ require_change_not(B)
require_change(C)
require_change(D)
# There's a bug in Ninja on Windows
-# https://gitlab.kitware.com/cmake/cmake/issues/16776
+# https://gitlab.kitware.com/cmake/cmake/-/issues/16776
if(NOT ("${CMAKE_GENERATOR}" MATCHES "Ninja"))
require_change(E)
endif()
diff --git a/Tests/QtAutogen/Tests.cmake b/Tests/QtAutogen/Tests.cmake
index 97efa72..0c7bd79 100644
--- a/Tests/QtAutogen/Tests.cmake
+++ b/Tests/QtAutogen/Tests.cmake
@@ -30,6 +30,7 @@ ADD_AUTOGEN_TEST(UicInterface QtAutoUicInterface)
ADD_AUTOGEN_TEST(UicNoGui uicNoGui)
ADD_AUTOGEN_TEST(UicOnly uicOnly)
ADD_AUTOGEN_TEST(UicSkipSource)
+ADD_AUTOGEN_TEST(UnityMocSource)
if(QT_TEST_ALLOW_QT_MACROS)
ADD_AUTOGEN_TEST(MocCMP0071)
diff --git a/Tests/QtAutogen/UnityMocSource/CMakeLists.txt b/Tests/QtAutogen/UnityMocSource/CMakeLists.txt
new file mode 100644
index 0000000..d472319
--- /dev/null
+++ b/Tests/QtAutogen/UnityMocSource/CMakeLists.txt
@@ -0,0 +1,12 @@
+cmake_minimum_required(VERSION 3.16)
+project(UnityMocSource)
+include("../AutogenGuiTest.cmake")
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_UNITY_BUILD ON)
+
+add_library(library library.cpp)
+target_link_libraries(library ${QT_LIBRARIES})
+
+add_executable(unityMocSource main.cpp)
+target_link_libraries(unityMocSource PRIVATE library)
diff --git a/Tests/QtAutogen/UnityMocSource/library.cpp b/Tests/QtAutogen/UnityMocSource/library.cpp
new file mode 100644
index 0000000..1e30d4b
--- /dev/null
+++ b/Tests/QtAutogen/UnityMocSource/library.cpp
@@ -0,0 +1,6 @@
+#include <QObject>
+class Test : public QObject
+{
+ Q_OBJECT
+};
+#include "library.moc"
diff --git a/Tests/QtAutogen/UnityMocSource/main.cpp b/Tests/QtAutogen/UnityMocSource/main.cpp
new file mode 100644
index 0000000..f8b643a
--- /dev/null
+++ b/Tests/QtAutogen/UnityMocSource/main.cpp
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}