summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/QtAutomoc/CMakeLists.txt2
-rw-r--r--Tests/QtAutomoc/abc.cpp4
-rw-r--r--Tests/QtAutomoc/main.cpp4
-rw-r--r--Tests/QtAutomoc/xyz.cpp28
-rw-r--r--Tests/QtAutomoc/xyz.h28
5 files changed, 65 insertions, 1 deletions
diff --git a/Tests/QtAutomoc/CMakeLists.txt b/Tests/QtAutomoc/CMakeLists.txt
index c81ac11..9f02618 100644
--- a/Tests/QtAutomoc/CMakeLists.txt
+++ b/Tests/QtAutomoc/CMakeLists.txt
@@ -13,7 +13,7 @@ add_definitions(-DFOO)
# create an executable and a library target, both requiring automoc:
add_library(codeeditorLib STATIC codeeditor.cpp)
-add_executable(foo main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp)
+add_executable(foo main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp xyz.cpp)
set_target_properties(foo codeeditorLib PROPERTIES AUTOMOC TRUE)
diff --git a/Tests/QtAutomoc/abc.cpp b/Tests/QtAutomoc/abc.cpp
index f922615..25071cd 100644
--- a/Tests/QtAutomoc/abc.cpp
+++ b/Tests/QtAutomoc/abc.cpp
@@ -37,5 +37,9 @@ void Abc::doAbc()
pa.print();
}
+// check that including the moc file for the cpp file and the header works:
#include "abc.moc"
#include "moc_abc.cpp"
+
+// check that including a moc file from another header works:
+#include "moc_xyz.cpp"
diff --git a/Tests/QtAutomoc/main.cpp b/Tests/QtAutomoc/main.cpp
index 5414daf..7eb29a3 100644
--- a/Tests/QtAutomoc/main.cpp
+++ b/Tests/QtAutomoc/main.cpp
@@ -46,6 +46,7 @@
#include "blub.h"
#include "sub/bar.h"
#include "abc.h"
+#include "xyz.h"
int main(int argv, char **args)
{
@@ -70,5 +71,8 @@ int main(int argv, char **args)
Abc abc;
abc.doAbc();
+ Xyz xyz;
+ xyz.doXyz();
+
return app.exec();
}
diff --git a/Tests/QtAutomoc/xyz.cpp b/Tests/QtAutomoc/xyz.cpp
new file mode 100644
index 0000000..a3562a3
--- /dev/null
+++ b/Tests/QtAutomoc/xyz.cpp
@@ -0,0 +1,28 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2004-2011 Kitware, Inc.
+ Copyright 2011 Alexander Neundorf (neundorf@kde.org)
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+
+
+#include "xyz.h"
+
+#include <stdio.h>
+
+Xyz::Xyz()
+:QObject()
+{
+}
+
+
+void Xyz::doXyz()
+{
+ printf("This is xyz !\n");
+}
diff --git a/Tests/QtAutomoc/xyz.h b/Tests/QtAutomoc/xyz.h
new file mode 100644
index 0000000..8175d37
--- /dev/null
+++ b/Tests/QtAutomoc/xyz.h
@@ -0,0 +1,28 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2004-2011 Kitware, Inc.
+ Copyright 2011 Alexander Neundorf (neundorf@kde.org)
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+
+#ifndef XYZ_H
+#define XYZ_H
+
+#include <QObject>
+
+class Xyz : public QObject
+{
+ Q_OBJECT
+ public:
+ Xyz();
+ public slots:
+ void doXyz();
+};
+
+#endif