From c46b030cd301fc2ff05830765952a668bbdbc188 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Mon, 5 Mar 2012 15:55:31 +1000 Subject: [PATCH] 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 --- tests/auto/headersclean/headersclean.pro | 13 ++++++----- ..._headersclean.cpp => qt_headersclean_headers.h} | 25 ++++++---------------- tests/auto/host.pro | 8 ++----- 3 files changed, 17 insertions(+), 29 deletions(-) rename tests/auto/headersclean/{tst_headersclean.cpp => qt_headersclean_headers.h} (83%) diff --git a/tests/auto/headersclean/headersclean.pro b/tests/auto/headersclean/headersclean.pro index 4ce05fe..379648e 100644 --- a/tests/auto/headersclean/headersclean.pro +++ b/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 diff --git a/tests/auto/headersclean/tst_headersclean.cpp b/tests/auto/headersclean/qt_headersclean_headers.h similarity index 83% rename from tests/auto/headersclean/tst_headersclean.cpp rename to tests/auto/headersclean/qt_headersclean_headers.h index d5131f9..d3f4e4b 100644 --- a/tests/auto/headersclean/tst_headersclean.cpp +++ b/tests/auto/headersclean/qt_headersclean_headers.h @@ -39,24 +39,13 @@ ** ****************************************************************************/ -#define QT_NO_KEYWORDS -#define signals int -#define slots int -#define emit public:; -#define foreach public:; -#define forever public:; - -#include -#include +#ifndef QT_HEADERSCLEAN_HEADERS +#define QT_HEADERSCLEAN_HEADERS +#include #include +#include +#include +#include -class tst_HeadersClean: public QObject -{ - Q_OBJECT -public: - tst_HeadersClean() {} -}; - -QTEST_MAIN(tst_HeadersClean) -#include "tst_headersclean.moc" +#endif diff --git a/tests/auto/host.pro b/tests/auto/host.pro index 0a96ef0..eab6de2 100644 --- a/tests/auto/host.pro +++ b/tests/auto/host.pro @@ -1,9 +1,5 @@ TEMPLATE=subdirs -# FIXME -# This test is crrently broken: -#SUBDIRS=\ - #headersclean \ - -SUBDIRS= +SUBDIRS=\ + headersclean \ -- 2.7.4