Fix test failures with shadow builds.
authorAndrew den Exter <andrew.den-exter@nokia.com>
Thu, 22 Dec 2011 01:30:03 +0000 (11:30 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 3 Jan 2012 01:27:06 +0000 (02:27 +0100)
QFINDTESTDATA uses __FILE__ to determine the source directory, which
means it finds the wrong source directory when the macro is used from
a shared base class.  Define the correct source directory in a pri
file and include that wherever QDeclarativeDataTest is used.

Change-Id: If3ef435f4bb3049733f49402338303c8b440f1fa
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>

63 files changed:
tests/auto/declarative/debugger/qdeclarativedebugjs/qdeclarativedebugjs.pro
tests/auto/declarative/debugger/qdeclarativedebugtrace/qdeclarativedebugtrace.pro
tests/auto/declarative/debugger/qv8profilerservice/qv8profilerservice.pro
tests/auto/declarative/qdeclarativeaccessibility/qdeclarativeaccessibility.pro
tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro
tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro
tests/auto/declarative/qdeclarativeconsole/qdeclarativeconsole.pro
tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro
tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro
tests/auto/declarative/qdeclarativeerror/qdeclarativeerror.pro
tests/auto/declarative/qdeclarativeexpression/qdeclarativeexpression.pro
tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro
tests/auto/declarative/qdeclarativeincubator/qdeclarativeincubator.pro
tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro
tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro
tests/auto/declarative/qdeclarativelistreference/qdeclarativelistreference.pro
tests/auto/declarative/qdeclarativelocale/qdeclarativelocale.pro
tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro
tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro
tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro
tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro
tests/auto/declarative/qdeclarativetranslation/qdeclarativetranslation.pro
tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro
tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro
tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro
tests/auto/declarative/v4/v4.pro
tests/auto/qtquick2/qdeclarativeanimations/qdeclarativeanimations.pro
tests/auto/qtquick2/qdeclarativebehaviors/qdeclarativebehaviors.pro
tests/auto/qtquick2/qdeclarativefontloader/qdeclarativefontloader.pro
tests/auto/qtquick2/qdeclarativepath/qdeclarativepath.pro
tests/auto/qtquick2/qdeclarativepixmapcache/qdeclarativepixmapcache.pro
tests/auto/qtquick2/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro
tests/auto/qtquick2/qdeclarativespringanimation/qdeclarativespringanimation.pro
tests/auto/qtquick2/qdeclarativestates/qdeclarativestates.pro
tests/auto/qtquick2/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro
tests/auto/qtquick2/qquickanchors/qquickanchors.pro
tests/auto/qtquick2/qquickanimatedimage/qquickanimatedimage.pro
tests/auto/qtquick2/qquickborderimage/qquickborderimage.pro
tests/auto/qtquick2/qquickcanvas/qquickcanvas.pro
tests/auto/qtquick2/qquickflickable/qquickflickable.pro
tests/auto/qtquick2/qquickflipable/qquickflipable.pro
tests/auto/qtquick2/qquickfocusscope/qquickfocusscope.pro
tests/auto/qtquick2/qquickgridview/qquickgridview.pro
tests/auto/qtquick2/qquickimage/qquickimage.pro
tests/auto/qtquick2/qquickitem/qquickitem.pro
tests/auto/qtquick2/qquickitem2/qquickitem2.pro
tests/auto/qtquick2/qquicklistview/qquicklistview.pro
tests/auto/qtquick2/qquickloader/qquickloader.pro
tests/auto/qtquick2/qquickmousearea/qquickmousearea.pro
tests/auto/qtquick2/qquickpathview/qquickpathview.pro
tests/auto/qtquick2/qquickpincharea/qquickpincharea.pro
tests/auto/qtquick2/qquickpositioners/qquickpositioners.pro
tests/auto/qtquick2/qquickrepeater/qquickrepeater.pro
tests/auto/qtquick2/qquickscreen/qquickscreen.pro
tests/auto/qtquick2/qquickspriteimage/qquickspriteimage.pro
tests/auto/qtquick2/qquicktext/qquicktext.pro
tests/auto/qtquick2/qquicktextedit/qquicktextedit.pro
tests/auto/qtquick2/qquicktextinput/qquicktextinput.pro
tests/auto/qtquick2/qquickview/qquickview.pro
tests/auto/qtquick2/qquickvisualdatamodel/qquickvisualdatamodel.pro
tests/auto/shared/util.cpp
tests/auto/shared/util.pri [new file with mode: 0644]

index f51b1f3..5618995 100644 (file)
@@ -3,19 +3,18 @@ TARGET = tst_qdeclarativedebugjs
 QT += declarative-private testlib
 macx:CONFIG -= app_bundle
 
-HEADERS += ../shared/debugutil_p.h \
-           ../../../shared/util.h
+HEADERS += ../shared/debugutil_p.h
 SOURCES +=     tst_qdeclarativedebugjs.cpp \
-            ../shared/debugutil.cpp \
-            ../../../shared/util.cpp
+            ../shared/debugutil.cpp
 
 INCLUDEPATH += ../shared
 
+include (../../../shared/util.pri)
+
 testDataFiles.files = data
 testDataFiles.path = .
 DEPLOYMENT += testDataFiles
 
-
 CONFIG += parallel_test
 
 OTHER_FILES += data/test.qml data/test.js \
index 112c8f0..487c63a 100644 (file)
@@ -2,15 +2,14 @@ CONFIG += testcase
 TARGET = tst_qdeclarativedebugtrace
 macx:CONFIG -= app_bundle
 
-HEADERS += ../shared/debugutil_p.h \
-           ../../../shared/util.h
+HEADERS += ../shared/debugutil_p.h
 
 SOURCES += tst_qdeclarativedebugtrace.cpp \
-           ../shared/debugutil.cpp \
-           ../../../shared/util.cpp
-
+           ../shared/debugutil.cpp
 OTHER_FILES += data/test.qml
 
+include (../../../shared/util.pri)
+
 CONFIG += parallel_test declarative_debug
 
 QT += declarative-private testlib
index 6ef7235..eb57dff 100644 (file)
@@ -2,12 +2,12 @@ CONFIG += testcase
 TARGET = tst_qv8profilerservice
 macx:CONFIG -= app_bundle
 
-HEADERS += ../shared/debugutil_p.h \
-           ../../../shared/util.h
+HEADERS += ../shared/debugutil_p.h
 
 SOURCES += tst_qv8profilerservice.cpp \
-           ../shared/debugutil.cpp \
-           ../../../shared/util.cpp
+           ../shared/debugutil.cpp
+
+include (../../../shared/util.pri)
 
 OTHER_FILES += data/test.qml
 
index 8b51656..d7bf5ea 100644 (file)
@@ -2,11 +2,9 @@ load(qttest_p4)
 contains(QT_CONFIG,declarative): QT += declarative-private gui network qtquick1-private
 macx:CONFIG -= app_bundle
 
-HEADERS +=  ../../shared/util.h
-
-SOURCES  += tst_qdeclarativeaccessibility.cpp \
-            ../../shared/util.cpp
+SOURCES  += tst_qdeclarativeaccessibility.cpp
 
+include (../../shared/util.pri)
 
 OTHER_FILES += data/pushbutton.qml
 OTHER_FILES += data/statictext.qml
index 83163cd..6098d03 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qdeclarativebinding
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qdeclarativebinding.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativebinding.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index d04ef75..2389ca4 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qdeclarativecomponent
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qdeclarativecomponent.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativecomponent.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 6e48be9..bb863c5 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qdeclarativeconnection
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qdeclarativeconnection.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativeconnection.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index b66866e..0563491 100644 (file)
@@ -1,8 +1,9 @@
 CONFIG += testcase
 TARGET = tst_qdeclarativeconsole
-SOURCES += tst_qdeclarativeconsole.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativeconsole.cpp
+
+include (../../shared/util.pri)
+
 macx:CONFIG -= app_bundle
 
 testDataFiles.files = data
index b1a0384..3e1cc01 100644 (file)
@@ -1,8 +1,9 @@
 CONFIG += testcase
 TARGET = tst_qdeclarativecontext
-SOURCES += tst_qdeclarativecontext.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativecontext.cpp
+
+include (../../shared/util.pri)
+
 macx:CONFIG -= app_bundle
 
 testDataFiles.files = data
index a8c8508..f4c2638 100644 (file)
@@ -4,13 +4,13 @@ macx:CONFIG -= app_bundle
 
 SOURCES += tst_qdeclarativeecmascript.cpp \
            testtypes.cpp \
-           ../../shared/testhttpserver.cpp \
-           ../../shared/util.cpp
+           ../../shared/testhttpserver.cpp
 HEADERS += testtypes.h \
-           ../../shared/testhttpserver.h \
-           ../../shared/util.h
+           ../../shared/testhttpserver.h
 INCLUDEPATH += ../../shared
 
+include (../../shared/util.pri)
+
 # QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage
 # LIBS += -lgcov
 
index 5d0bb98..8acf46f 100644 (file)
@@ -1,8 +1,9 @@
 CONFIG += testcase
 TARGET = tst_qdeclarativeerror
-SOURCES += tst_qdeclarativeerror.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativeerror.cpp
+
+include (../../shared/util.pri)
+
 macx:CONFIG -= app_bundle
 
 CONFIG += parallel_test
index d9c2da6..bd32e6a 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qdeclarativeexpression
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qdeclarativeexpression.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativeexpression.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 5f33716..045d48a 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qdeclarativefolderlistmodel
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qdeclarativefolderlistmodel.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativefolderlistmodel.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 947b160..90a6720 100644 (file)
@@ -3,11 +3,11 @@ TARGET = tst_qdeclarativeincubator
 macx:CONFIG -= app_bundle
 
 SOURCES += tst_qdeclarativeincubator.cpp \
-           testtypes.cpp \
-           ../../shared/util.cpp
+           testtypes.cpp
 
-HEADERS += testtypes.h \
-           ../../shared/util.h
+HEADERS += testtypes.h
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 8d09720..af46671 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qdeclarativeinfo
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qdeclarativeinfo.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativeinfo.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 460bbfe..25db0f9 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qdeclarativelistmodel
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qdeclarativelistmodel.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativelistmodel.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 37778aa..7900f3c 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qdeclarativelistreference
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qdeclarativelistreference.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativelistreference.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index c01bacf..75ff0e9 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qdeclarativelocale
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qdeclarativelocale.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativelocale.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 551d8ea..58f329d 100644 (file)
@@ -1,13 +1,13 @@
 CONFIG += testcase
 TARGET = tst_qdeclarativemoduleplugin
 
-HEADERS = ../../shared/testhttpserver.h \
-          ../../shared/util.h
+HEADERS = ../../shared/testhttpserver.h
 SOURCES = tst_qdeclarativemoduleplugin.cpp \
-          ../../shared/testhttpserver.cpp \
-          ../../shared/util.cpp
+          ../../shared/testhttpserver.cpp
 CONFIG -= app_bundle
 
+include (../../shared/util.pri)
+
 testDataFiles.files = data
 testDataFiles.path = .
 DEPLOYMENT += testDataFiles
index bf81e1c..45b240b 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qdeclarativeproperty
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qdeclarativeproperty.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativeproperty.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 8b40936..5ed8088 100644 (file)
@@ -1,8 +1,8 @@
 CONFIG += testcase
 TARGET = tst_qdeclarativeqt
-SOURCES += tst_qdeclarativeqt.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativeqt.cpp
+
+include (../../shared/util.pri)
 
 macx:CONFIG -= app_bundle
 
index d3195df..cc27d17 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qdeclarativesqldatabase
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qdeclarativesqldatabase.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativesqldatabase.cpp
+
+include (../../shared/util.pri)
 
 CONFIG += parallel_test
 
index 5b40df8..d6f067e 100644 (file)
@@ -2,11 +2,11 @@ CONFIG += testcase
 TARGET = tst_qdeclarativetranslation
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qdeclarativetranslation.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativetranslation.cpp
 RESOURCES += data/translation.qrc
 
+include (../../shared/util.pri)
+
 testDataFiles.files = data
 testDataFiles.path = .
 DEPLOYMENT += testDataFiles
index a240f30..2968c88 100644 (file)
@@ -2,12 +2,12 @@ CONFIG += testcase
 TARGET = tst_qdeclarativevaluetypes
 macx:CONFIG -= app_bundle
 
-HEADERS += testtypes.h \
-           ../../shared/util.h
+HEADERS += testtypes.h
 
 SOURCES += tst_qdeclarativevaluetypes.cpp \
-           testtypes.cpp \
-           ../../shared/util.cpp
+           testtypes.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 584bcd6..9e5cc43 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qdeclarativeworkerscript
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qdeclarativeworkerscript.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativeworkerscript.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index fd6a19d..b8f09f8 100644 (file)
@@ -3,12 +3,12 @@ TARGET = tst_qdeclarativexmlhttprequest
 macx:CONFIG -= app_bundle
 
 INCLUDEPATH += ../../shared/
-HEADERS += ../../shared/testhttpserver.h \
-           ../../shared/util.h
+HEADERS += ../../shared/testhttpserver.h
 
 SOURCES += tst_qdeclarativexmlhttprequest.cpp \
-           ../../shared/testhttpserver.cpp \
-           ../../shared/util.cpp
+           ../../shared/testhttpserver.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index b14be36..81d12f8 100644 (file)
@@ -3,10 +3,10 @@ TARGET = tst_qdeclarativev4
 macx:CONFIG -= app_bundle
 
 SOURCES += tst_v4.cpp \
-           testtypes.cpp \
-           ../../shared/util.cpp
-HEADERS += testtypes.h \
-           ../../shared/util.h
+           testtypes.cpp
+HEADERS += testtypes.h
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index f5bebb3..d15e86c 100644 (file)
@@ -1,8 +1,8 @@
 CONFIG += testcase
 TARGET = tst_qdeclarativeanimations
-SOURCES += tst_qdeclarativeanimations.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativeanimations.cpp
+
+include (../../shared/util.pri)
 
 macx:CONFIG -= app_bundle
 
index e68c68a..7089f1c 100644 (file)
@@ -1,8 +1,8 @@
 CONFIG += testcase
 TARGET = tst_qdeclarativebehaviors
-SOURCES += tst_qdeclarativebehaviors.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativebehaviors.cpp
+
+include (../../shared/util.pri)
 
 macx:CONFIG -= app_bundle
 
index e257696..0e84fc9 100644 (file)
@@ -2,11 +2,11 @@ CONFIG += testcase
 TARGET = tst_qdeclarativefontloader
 macx:CONFIG -= app_bundle
 
-HEADERS += ../../shared/testhttpserver.h \
-           ../../shared/util.h
+HEADERS += ../../shared/testhttpserver.h
 SOURCES += tst_qdeclarativefontloader.cpp \
-           ../../shared/testhttpserver.cpp \
-           ../../shared/util.cpp
+           ../../shared/testhttpserver.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index caadcbd..1936d53 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qdeclarativepath
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qdeclarativepath.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativepath.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 1cc8149..0eb21af 100644 (file)
@@ -3,12 +3,12 @@ TARGET = tst_qdeclarativepixmapcache
 macx:CONFIG -= app_bundle
 
 SOURCES += tst_qdeclarativepixmapcache.cpp \
-           ../../shared/testhttpserver.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/testhttpserver.h \
-           ../../shared/util.h
+           ../../shared/testhttpserver.cpp
+HEADERS += ../../shared/testhttpserver.h
 INCLUDEPATH += ../../shared/
 
+include (../../shared/util.pri)
+
 importFiles.files = data
 importFiles.path = .
 DEPLOYMENT += importFiles
index 044a796..41650c5 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qdeclarativesmoothedanimation
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qdeclarativesmoothedanimation.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativesmoothedanimation.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 9c7000a..d90cf3d 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qdeclarativespringanimation
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qdeclarativespringanimation.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativespringanimation.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index dbf7441..74f5bef 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qdeclarativestates
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qdeclarativestates.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativestates.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index f5628fb..37f1c65 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qdeclarativexmllistmodel
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qdeclarativexmllistmodel.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qdeclarativexmllistmodel.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 03b99e1..25711d4 100644 (file)
@@ -1,8 +1,8 @@
 TARGET = tst_qquickanchors
 CONFIG += testcase
-SOURCES += tst_qquickanchors.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qquickanchors.cpp
+
+include (../../shared/util.pri)
 
 macx:CONFIG -= app_bundle
 
index c8c3bdb..d776a73 100644 (file)
@@ -1,10 +1,10 @@
 CONFIG += testcase
 TARGET = tst_qquickanimatedimage
-HEADERS += ../../shared/testhttpserver.h \
-            ../../shared/util.h
+HEADERS += ../../shared/testhttpserver.h
 SOURCES += tst_qquickanimatedimage.cpp \
-           ../../shared/testhttpserver.cpp \
-            ../../shared/util.cpp
+           ../../shared/testhttpserver.cpp
+
+include (../../shared/util.pri)
 
 macx:CONFIG -= app_bundle
 
index 23c504d..2073b44 100644 (file)
@@ -2,11 +2,11 @@ CONFIG += testcase
 TARGET = tst_qquickborderimage
 macx:CONFIG -= app_bundle
 
-HEADERS += ../../shared/testhttpserver.h \
-           ../../shared/util.h
+HEADERS += ../../shared/testhttpserver.h
 SOURCES += tst_qquickborderimage.cpp \
-           ../../shared/testhttpserver.cpp \
-           ../../shared/util.cpp
+           ../../shared/testhttpserver.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 3aa3894..b21b492 100644 (file)
@@ -1,8 +1,8 @@
 CONFIG += testcase
 TARGET = tst_qquickcanvas
-SOURCES += tst_qquickcanvas.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qquickcanvas.cpp
+
+include (../../shared/util.pri)
 
 macx:CONFIG -= app_bundle
 
index 6c2a2a6..6939130 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qquickflickable
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qquickflickable.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qquickflickable.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index d1932fc..3afad83 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qquickflipable
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qquickflipable.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qquickflipable.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 1167643..75bd663 100644 (file)
@@ -1,8 +1,8 @@
 CONFIG += testcase
 TARGET = tst_qquickfocusscope
-SOURCES += tst_qquickfocusscope.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qquickfocusscope.cpp
+
+include (../../shared/util.pri)
 
 macx:CONFIG -= app_bundle
 
index 32bf0ec..ad026f0 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qquickgridview
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qquickgridview.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qquickgridview.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 07dd5fe..64a1a8f 100644 (file)
@@ -2,11 +2,11 @@ CONFIG += testcase
 TARGET = tst_qquickimage
 macx:CONFIG -= app_bundle
 
-HEADERS += ../../shared/testhttpserver.h \
-           ../../shared/util.h
+HEADERS += ../../shared/testhttpserver.h
 SOURCES += tst_qquickimage.cpp \
-           ../../shared/testhttpserver.cpp \
-           ../../shared/util.cpp
+           ../../shared/testhttpserver.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index a29641c..70f6b15 100644 (file)
@@ -1,8 +1,8 @@
 CONFIG += testcase
 TARGET = tst_qquickitem
-SOURCES += tst_qquickitem.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qquickitem.cpp
+
+include (../../shared/util.pri)
 
 macx:CONFIG -= app_bundle
 
index 75a6d88..44d3ba3 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qquickitem2
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qquickitem.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qquickitem.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 16e0695..8b05b74 100644 (file)
@@ -2,11 +2,11 @@ CONFIG += testcase
 TARGET = tst_qquicklistview
 macx:CONFIG -= app_bundle
 
-HEADERS += incrementalmodel.h \
-           ../../shared/util.h
+HEADERS += incrementalmodel.h
 SOURCES += tst_qquicklistview.cpp \
-           incrementalmodel.cpp \
-           ../../shared/util.cpp
+           incrementalmodel.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index c22ed63..33c8c20 100644 (file)
@@ -3,12 +3,12 @@ TARGET = tst_qquickloader
 macx:CONFIG -= app_bundle
 
 INCLUDEPATH += ../../shared/
-HEADERS += ../../shared/testhttpserver.h \
-           ../../shared/util.h
+HEADERS += ../../shared/testhttpserver.h
 
 SOURCES += tst_qquickloader.cpp \
-           ../../shared/testhttpserver.cpp \
-           ../../shared/util.cpp
+           ../../shared/testhttpserver.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index cd1a44e..67d77dc 100644 (file)
@@ -2,11 +2,11 @@ CONFIG += testcase
 TARGET = tst_qquickmousearea
 macx:CONFIG -= app_bundle
 
-HEADERS += ../../shared/testhttpserver.h \
-           ../../shared/util.h
+HEADERS += ../../shared/testhttpserver.h
 SOURCES += tst_qquickmousearea.cpp \
-           ../../shared/testhttpserver.cpp \
-           ../../shared/util.cpp
+           ../../shared/testhttpserver.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 7a414cd..3d2a4ff 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qquickpathview
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qquickpathview.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qquickpathview.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index f5fb246..3c75079 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qquickpincharea
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qquickpincharea.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qquickpincharea.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 729b61e..ec0056f 100644 (file)
@@ -1,8 +1,8 @@
 CONFIG += testcase
 TARGET = tst_qquickpositioners
-SOURCES += tst_qquickpositioners.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qquickpositioners.cpp
+
+include (../../shared/util.pri)
 
 macx:CONFIG -= app_bundle
 
index efd7538..fa1781f 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qquickrepeater
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qquickrepeater.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qquickrepeater.cpp
+
+include (../../shared/util.pri)
 
 testFiles.files = data
 testFiles.path = .
index 8d6a32b..9e84512 100644 (file)
@@ -1,8 +1,8 @@
 CONFIG += testcase
 TARGET = tst_qquickscreen
-SOURCES += tst_qquickscreen.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qquickscreen.cpp
+
+include (../../shared/util.pri)
 
 macx:CONFIG -= app_bundle
 
index 062a1b9..0d63007 100644 (file)
@@ -1,8 +1,8 @@
 CONFIG += testcase
 TARGET = tst_qquickspriteimage
-SOURCES += tst_qquickspriteimage.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qquickspriteimage.cpp
+
+include (../../shared/util.pri)
 
 macx:CONFIG -= app_bundle
 
index 5c55714..b483beb 100644 (file)
@@ -5,10 +5,10 @@ macx:CONFIG -= app_bundle
 SOURCES += tst_qquicktext.cpp
 
 INCLUDEPATH += ../../shared/
-HEADERS += ../../shared/testhttpserver.h \
-           ../../shared/util.h
-SOURCES += ../../shared/testhttpserver.cpp \
-           ../../shared/util.cpp
+HEADERS += ../../shared/testhttpserver.h
+SOURCES += ../../shared/testhttpserver.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index b647377..6f74761 100644 (file)
@@ -3,11 +3,11 @@ TARGET = tst_qquicktextedit
 macx:CONFIG -= app_bundle
 
 SOURCES += tst_qquicktextedit.cpp \
-           ../../shared/testhttpserver.cpp \
-           ../../shared/util.cpp
+           ../../shared/testhttpserver.cpp
 
-HEADERS += ../../shared/testhttpserver.h \
-           ../../shared/util.h
+HEADERS += ../../shared/testhttpserver.h
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 3c21307..08ce675 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qquicktextinput
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qquicktextinput.cpp \
-          ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qquicktextinput.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 90ad693..c3bc0dd 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qquickview
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qquickview.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qquickview.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index 3a194c5..26112cf 100644 (file)
@@ -2,9 +2,9 @@ CONFIG += testcase
 TARGET = tst_qquickvisualdatamodel
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qquickvisualdatamodel.cpp \
-           ../../shared/util.cpp
-HEADERS += ../../shared/util.h
+SOURCES += tst_qquickvisualdatamodel.cpp
+
+include (../../shared/util.pri)
 
 testDataFiles.files = data
 testDataFiles.path = .
index a9d4bbc..d5d6393 100644 (file)
 QDeclarativeDataTest *QDeclarativeDataTest::m_instance = 0;
 
 QDeclarativeDataTest::QDeclarativeDataTest() :
-    m_dataDirectory(QFINDTESTDATA("data")),
+#ifdef QT_TESTCASE_BUILDDIR
+    m_dataDirectory(QTest::qFindTestData("data", QT_DECLARATIVETEST_DATADIR, 0, QT_TESTCASE_BUILDDIR)),
+#else
+    m_dataDirectory(QTest::qFindTestData("data", QT_DECLARATIVETEST_DATADIR, 0)),
+#endif
+
     m_dataDirectoryUrl(QUrl::fromLocalFile(m_dataDirectory + QLatin1Char('/')))
 {
     m_instance = this;
diff --git a/tests/auto/shared/util.pri b/tests/auto/shared/util.pri
new file mode 100644 (file)
index 0000000..916e5fb
--- /dev/null
@@ -0,0 +1,5 @@
+
+HEADERS += $$PWD/util.h
+SOURCES += $$PWD/util.cpp
+
+DEFINES += QT_DECLARATIVETEST_DATADIR=\\\"$${_PRO_FILE_PWD_}/data\\\"