summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools/moc
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-01-20 18:16:08 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-01-20 18:18:59 +0100
commit9033977d3971db5352a2bb51052a723a2ac57a8f (patch)
treed1a70bdf5e892cc391f7bbfd61ff5611fe25ce3d /tests/auto/tools/moc
parente5e43a2386fb4a4c2cb90d5a8d9bb5ca81a2675e (diff)
parent03b6a2f0f98b70b24c0cce645d6d58c084111f91 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qstring.cpp src/gui/image/image.pri src/gui/image/qimage.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/eglfs/qeglfshooks_stub.cpp tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp Change-Id: I3b9ba029c8f2263b011f204fdf68c3231c6d4ce5
Diffstat (limited to 'tests/auto/tools/moc')
-rw-r--r--tests/auto/tools/moc/moc.pro3
-rw-r--r--tests/auto/tools/moc/parse-defines.h12
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp3
3 files changed, 17 insertions, 1 deletions
diff --git a/tests/auto/tools/moc/moc.pro b/tests/auto/tools/moc/moc.pro
index 320887637d..70a1ecd476 100644
--- a/tests/auto/tools/moc/moc.pro
+++ b/tests/auto/tools/moc/moc.pro
@@ -45,3 +45,6 @@ DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
# Ensure that plugin_metadata.h are moc-ed with some extra -M arguments:
QMAKE_MOC_OPTIONS += -Muri=com.company.app -Muri=com.company.app.private
+# Define macro on the command lines used in parse-defines.h
+QMAKE_MOC_OPTIONS += "-DDEFINE_CMDLINE_EMPTY=" "\"-DDEFINE_CMDLINE_SIGNAL=void cmdlineSignal(const QMap<int, int> &i)\""
+
diff --git a/tests/auto/tools/moc/parse-defines.h b/tests/auto/tools/moc/parse-defines.h
index aaadcef601..35934853f0 100644
--- a/tests/auto/tools/moc/parse-defines.h
+++ b/tests/auto/tools/moc/parse-defines.h
@@ -79,9 +79,16 @@
#define PD_ADD_SUFFIX(x) PD_DEFINE1(x,_SUFFIX)
#define PD_DEFINE_ITSELF PD_ADD_SUFFIX(PD_DEFINE_ITSELF)
+#ifndef Q_MOC_RUN
+// macro defined on the command line (in tst_moc.pro)
+#define DEFINE_CMDLINE_EMPTY
+#define DEFINE_CMDLINE_SIGNAL void cmdlineSignal(const QMap<int, int> &i)
+#endif
+
PD_BEGIN_NAMESPACE
-class PD_CLASSNAME : public QObject
+class DEFINE_CMDLINE_EMPTY PD_CLASSNAME DEFINE_CMDLINE_EMPTY
+ : public DEFINE_CMDLINE_EMPTY QObject DEFINE_CMDLINE_EMPTY
{
Q_OBJECT
Q_CLASSINFO("TestString", PD_STRINGIFY(PD_CLASSNAME))
@@ -140,6 +147,9 @@ public slots:
void PD_DEFINE_ITSELF(int) {}
+signals:
+ DEFINE_CMDLINE_SIGNAL;
+
};
#undef QString
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index e0e6129075..38d31509d5 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -3042,6 +3042,9 @@ void tst_Moc::parseDefines()
index = mo->indexOfSlot("PD_DEFINE_ITSELF_SUFFIX(int)");
QVERIFY(index != -1);
+
+ index = mo->indexOfSignal("cmdlineSignal(QMap<int,int>)");
+ QVERIFY(index != -1);
}
void tst_Moc::preprocessorOnly()