Make headersclean in qtdeclarative enforce correct header conventions.
authorRohan McGovern <rohan.mcgovern@nokia.com>
Mon, 5 Mar 2012 05:55:31 +0000 (15:55 +1000)
committerQt by Nokia <qt-info@nokia.com>
Sun, 11 Mar 2012 22:18:42 +0000 (23:18 +0100)
This test wasn't testing much before.
Refactor it to reuse headersclean from qtbase.

It will now fail to compile if the headers from this module don't follow
the rules.

Change-Id: I2816b85543da74f66b993b7ee705cdb9e1c0f1c8
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
tests/auto/headersclean/headersclean.pro
tests/auto/headersclean/qt_headersclean_headers.h [moved from tests/auto/headersclean/tst_headersclean.cpp with 83% similarity]
tests/auto/host.pro

index 4ce05fe..379648e 100644 (file)
@@ -1,6 +1,9 @@
-CONFIG += testcase
-TARGET = tst_headersclean
-SOURCES  += tst_headersclean.cpp
-QT = core testlib
+QT = core testlib declarative qml quick qmltest qmldevtools
+HEADERSCLEAN_PRI = $${QT.core.sources}/../../tests/auto/other/headersclean/headersclean.pri
+isEmpty(QT.core.sources)|!include($$HEADERSCLEAN_PRI) {
+    warning("headersclean.pri from QtCore sources not available.  test disabled")
+    TEMPLATE=subdirs
+}
 
-contains(QT_CONFIG,qml): QT += qml qml-private
+# shadowing problems in scenegraph, allow it for now
+*-g++*: QMAKE_CXXFLAGS -= -Wshadow
 **
 ****************************************************************************/
 
-#define QT_NO_KEYWORDS
-#define signals int
-#define slots int
-#define emit public:;
-#define foreach public:;
-#define forever public:;
-
-#include <QtCore/QtCore>
-#include <QtTest/QtTest>
+#ifndef QT_HEADERSCLEAN_HEADERS
+#define QT_HEADERSCLEAN_HEADERS
 
+#include <QtDeclarative/QtDeclarative>
 #include <QtQml/QtQml>
+#include <QtQmlDevTools/QtQmlDevTools>
+#include <QtQuick/QtQuick>
+#include <QtQuickTest/QtQuickTest>
 
-class tst_HeadersClean: public QObject
-{
-    Q_OBJECT
-public:
-    tst_HeadersClean() {}
-};
-
-QTEST_MAIN(tst_HeadersClean)
-#include "tst_headersclean.moc"
+#endif
index 0a96ef0..eab6de2 100644 (file)
@@ -1,9 +1,5 @@
 TEMPLATE=subdirs
 
-# FIXME
-# This test is crrently broken:
-#SUBDIRS=\
-           #headersclean \
-
-SUBDIRS=
+SUBDIRS=\
+        headersclean \