Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make headersclean in qtdeclarative enforce correct header conventions.
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>
  • Loading branch information
Rohan McGovern authored and Qt by Nokia committed Mar 11, 2012
1 parent ed74ec4 commit c46b030
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 29 deletions.
13 changes: 8 additions & 5 deletions tests/auto/headersclean/headersclean.pro
@@ -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
Expand Up @@ -39,24 +39,13 @@
**
****************************************************************************/

#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
8 changes: 2 additions & 6 deletions tests/auto/host.pro
@@ -1,9 +1,5 @@
TEMPLATE=subdirs

# FIXME
# This test is crrently broken:
#SUBDIRS=\
#headersclean \

SUBDIRS=
SUBDIRS=\
headersclean \

0 comments on commit c46b030

Please sign in to comment.