Don't build empty tests.
authorJason McDonald <jason.mcdonald@nokia.com>
Wed, 12 Oct 2011 05:44:20 +0000 (15:44 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 13 Oct 2011 23:42:47 +0000 (01:42 +0200)
These tests need the xmlpatterns module.  If that module is not in the
Qt build, then avoid building the test rather than building an empty
test.

Change-Id: Id0f72cfc9f818096361ecbc439196d2d5c64322e
Reviewed-on: http://codereview.qt-project.org/6487
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
tests/auto/declarative/declarative.pro
tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro
tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp
tests/auto/qtquick1/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro
tests/auto/qtquick1/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp
tests/auto/qtquick1/qtquick1.pro

index a6bbd67..6e14648 100644 (file)
@@ -60,6 +60,9 @@ PRIVATETESTS += \
     qpacketprotocol \
     v4
 
+# This test requires the xmlpatterns module
+!contains(QT_CONFIG,xmlpatterns):PRIVATETESTS -= qdeclarativexmllistmodel
+
 SGTESTS =  \
     qsganimatedimage \
     qsgborderimage \
index ab850dd..4366c31 100644 (file)
@@ -1,9 +1,5 @@
 CONFIG += testcase
 TARGET = tst_qdeclarativexmllistmodel
-contains(QT_CONFIG,xmlpatterns) {
-    QT += xmlpatterns
-    DEFINES += QTEST_XMLPATTERNS
-}
 macx:CONFIG -= app_bundle
 
 SOURCES += tst_qdeclarativexmllistmodel.cpp
@@ -12,4 +8,4 @@ DEFINES += SRCDIR=\\\"$$PWD\\\"
 
 CONFIG += parallel_test
 
-QT += core-private gui-private v8-private declarative-private network testlib
+QT += core-private gui-private v8-private declarative-private network testlib xmlpatterns
index 252aea7..04eb7c6 100644 (file)
@@ -53,7 +53,6 @@
 #include <QtCore/qfile.h>
 #include <QtCore/qtemporaryfile.h>
 
-#ifdef QTEST_XMLPATTERNS
 #include <QtDeclarative/qdeclarativeengine.h>
 #include <QtDeclarative/qdeclarativecomponent.h>
 #include <private/qdeclarativexmllistmodel_p.h>
@@ -960,7 +959,3 @@ void tst_qdeclarativexmllistmodel::roleCrash()
 QTEST_MAIN(tst_qdeclarativexmllistmodel)
 
 #include "tst_qdeclarativexmllistmodel.moc"
-
-#else
-QTEST_NOOP_MAIN
-#endif
index ea9f75b..fc74409 100644 (file)
@@ -1,9 +1,5 @@
 CONFIG += testcase
 TARGET = tst_qdeclarativexmllistmodel
-contains(QT_CONFIG,xmlpatterns) {
-    QT += xmlpatterns
-    DEFINES += QTEST_XMLPATTERNS
-}
 macx:CONFIG -= app_bundle
 
 SOURCES += tst_qdeclarativexmllistmodel.cpp
@@ -12,4 +8,4 @@ DEFINES += SRCDIR=\\\"$$PWD\\\"
 
 CONFIG += parallel_test
 
-QT += core-private gui-private widgets-private v8-private declarative-private qtquick1-private network testlib
+QT += core-private gui-private widgets-private v8-private declarative-private qtquick1-private network testlib xmlpatterns
index 6a919a1..021d389 100644 (file)
@@ -53,7 +53,6 @@
 #include <QtCore/qfile.h>
 #include <QtCore/qtemporaryfile.h>
 
-#ifdef QTEST_XMLPATTERNS
 #include <QtDeclarative/qdeclarativeengine.h>
 #include <QtDeclarative/qdeclarativecomponent.h>
 #include <QtQuick1/private/qdeclarativexmllistmodel_p.h>
@@ -954,7 +953,3 @@ void tst_qdeclarativexmllistmodel::roleCrash()
 QTEST_MAIN(tst_qdeclarativexmllistmodel)
 
 #include "tst_qdeclarativexmllistmodel.moc"
-
-#else
-QTEST_NOOP_MAIN
-#endif
index bc97410..f1177cd 100644 (file)
@@ -45,4 +45,6 @@ contains(QT_CONFIG, private_tests) {
            qdeclarativexmllistmodel \
            examples
 
+    # This test needs the xmlpatterns module
+    !contains(QT_CONFIG,xmlpatterns): SUBDIRS -= qdeclarativexmllistmodel
 }