Changed qml tests to work from install directory
authorKurt Korbatits <kurt.korbatits@nokia.com>
Tue, 6 Mar 2012 04:01:34 +0000 (14:01 +1000)
committerQt by Nokia <qt-info@nokia.com>
Wed, 7 Mar 2012 05:24:18 +0000 (06:24 +0100)
- Changed tests to use TESTDATA
- moved qqmlcontext to private test as it contains private header
- added check for cross_compile option to skip when sources not available

Change-Id: I0f68f58ffcb1b41b8e40a9851e3e003fe72ee2f9
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>

35 files changed:
tests/auto/qml/debugger/qdebugmessageservice/qdebugmessageservice.pro
tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs.pro
tests/auto/qml/parserstress/parserstress.pro
tests/auto/qml/parserstress/tst_parserstress.cpp
tests/auto/qml/qjsengine/qjsengine.pro
tests/auto/qml/qml.pro
tests/auto/qml/qmlmin/qmlmin.pro
tests/auto/qml/qmlmin/tst_qmlmin.cpp
tests/auto/qml/qqmlcomponent/qqmlcomponent.pro
tests/auto/qml/qqmlconsole/qqmlconsole.pro
tests/auto/qml/qqmlcontext/qqmlcontext.pro
tests/auto/qml/qqmlecmascript/qqmlecmascript.pro
tests/auto/qml/qqmlerror/qqmlerror.pro
tests/auto/qml/qqmlexpression/qqmlexpression.pro
tests/auto/qml/qqmlincubator/qqmlincubator.pro
tests/auto/qml/qqmlinfo/qqmlinfo.pro
tests/auto/qml/qqmllanguage/qqmllanguage.pro
tests/auto/qml/qqmllistreference/qqmllistreference.pro
tests/auto/qml/qqmllocale/qqmllocale.pro
tests/auto/qml/qqmlmetaobject/qqmlmetaobject.pro
tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.pro
tests/auto/qml/qqmlparser/qqmlparser.pro
tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
tests/auto/qml/qqmlproperty/qqmlproperty.pro
tests/auto/qml/qqmlqt/qqmlqt.pro
tests/auto/qml/qqmlsqldatabase/qqmlsqldatabase.pro
tests/auto/qml/qqmltranslation/qqmltranslation.pro
tests/auto/qml/qqmlvaluetypes/qqmlvaluetypes.pro
tests/auto/qml/qqmlxmlhttprequest/qqmlxmlhttprequest.pro
tests/auto/qml/qquickbinding/qquickbinding.pro
tests/auto/qml/qquickconnection/qquickconnection.pro
tests/auto/qml/qquickfolderlistmodel/qquickfolderlistmodel.pro
tests/auto/qml/qquicklistmodel/qquicklistmodel.pro
tests/auto/qml/qquickworkerscript/qquickworkerscript.pro
tests/auto/qml/v4/v4.pro

index afda4b2..d62a262 100644 (file)
@@ -12,9 +12,7 @@ INCLUDEPATH += ../shared
 
 include(../../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 
index 72b0e77..7bb5161 100644 (file)
@@ -11,9 +11,7 @@ INCLUDEPATH += ../shared
 
 include (../../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 
index 3cf3e02..6885de3 100644 (file)
@@ -4,8 +4,7 @@ macx:CONFIG -= app_bundle
 
 SOURCES += tst_parserstress.cpp
 
-DEFINES += SRCDIR=\\\"$$PWD\\\"
-DEFINES += TESTDATADIR=\\\"$$PWD/tests\\\"
+TESTDATA = tests/*
 
 CONFIG += parallel_test
 
index c7f4840..a179a24 100644 (file)
@@ -86,15 +86,16 @@ QStringList tst_parserstress::findJSFiles(const QDir &d)
 
 void tst_parserstress::ecmascript_data()
 {
-#ifdef TESTDATADIR
-    QDir dir(TESTDATADIR);
+    QString testDataDir = QFileInfo(QFINDTESTDATA("tests/shell.js")).absolutePath();
+    QVERIFY2(!testDataDir.isEmpty(), qPrintable("Cannot find testDataDir!"));
+
+    QDir dir(testDataDir);
     QStringList files = findJSFiles(dir);
 
     QTest::addColumn<QString>("file");
     foreach (const QString &file, files) {
         QTest::newRow(qPrintable(file)) << file;
     }
-#endif
 }
 
 void tst_parserstress::ecmascript()
@@ -126,8 +127,9 @@ void tst_parserstress::ecmascript()
     QByteArray qmlData = qml.toUtf8();
 
     QQmlComponent component(&engine);
-    
-    component.setData(qmlData, QUrl::fromLocalFile(SRCDIR + QString("/dummy.qml")));
+
+    QString dummyFile = QFINDTESTDATA("dummy.qml");
+    component.setData(qmlData, QUrl::fromLocalFile(dummyFile));
 
     QFileInfo info(file);
 
index 3451157..6c0f91e 100644 (file)
@@ -3,11 +3,5 @@ TARGET = tst_qjsengine
 QT += qml widgets testlib
 macx:CONFIG -= app_bundle
 SOURCES += tst_qjsengine.cpp
-wince* {
-    addFiles.files = script
-    addFiles.path = .
-    DEPLOYMENT += addFiles
-    DEFINES += SRCDIR=\\\"./\\\"
-} else {
-    DEFINES += SRCDIR=\\\"$$PWD\\\"
-}
+
+TESTDATA = script/*
index bcfbcbd..6892680 100644 (file)
@@ -12,7 +12,6 @@ PUBLICTESTS += \
     qmlplugindump \
     qqmlcomponent \
     qqmlconsole \
-    qqmlcontext \
     qqmlengine \
     qqmlerror \
     qqmlincubator \
@@ -31,6 +30,7 @@ PRIVATETESTS += \
     animation \
     qqmlcpputils \
     qqmlecmascript \
+    qqmlcontext \
     qqmlexpression \
     qqmlimageprovider \
     qqmlinstruction \
index 49a4e7f..fc0ce12 100644 (file)
@@ -7,3 +7,5 @@ SOURCES += tst_qmlmin.cpp
 DEFINES += SRCDIR=\\\"$$PWD\\\"
 
 CONFIG += parallel_test
+
+cross_compile: DEFINES += QTEST_CROSS_COMPILED
index dfc88fb..3be7919 100644 (file)
@@ -175,6 +175,10 @@ void tst_qmlmin::qmlMinify()
 {
     QFETCH(QString, file);
 
+#if defined(QTEST_CROSS_COMPILED)
+    QSKIP("sources not available when cross compiled");
+#endif
+
     QProcess qmlminify;
     qmlminify.start(qmlminPath, QStringList() << QLatin1String("--verify-only") << file);
     qmlminify.waitForFinished();
index 7cef181..cf1c398 100644 (file)
@@ -6,9 +6,7 @@ SOURCES += tst_qqmlcomponent.cpp
 
 include (../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 
index 9ae2331..8e76f53 100644 (file)
@@ -6,9 +6,7 @@ include (../../shared/util.pri)
 
 macx:CONFIG -= app_bundle
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 
index 9920766..aaae3b8 100644 (file)
@@ -6,9 +6,7 @@ include (../../shared/util.pri)
 
 macx:CONFIG -= app_bundle
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 
index b07e439..553dc43 100644 (file)
@@ -14,9 +14,7 @@ include (../../shared/util.pri)
 # QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage
 # LIBS += -lgcov
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 QT += core-private gui-private v8-private qml-private network widgets testlib
index be2b9ab..918aa85 100644 (file)
@@ -8,8 +8,6 @@ macx:CONFIG -= app_bundle
 
 CONFIG += parallel_test
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 QT += core-private gui-private qml-private testlib
index c2c1aa8..0c529ed 100644 (file)
@@ -6,9 +6,7 @@ SOURCES += tst_qqmlexpression.cpp
 
 include (../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 
index 956d724..b6ce22d 100644 (file)
@@ -9,9 +9,7 @@ HEADERS += testtypes.h
 
 include (../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 
index 21dc2c7..050bad6 100644 (file)
@@ -6,9 +6,7 @@ SOURCES += tst_qqmlinfo.cpp
 
 include (../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 QT += core-private gui-private qml-private widgets testlib
index 41b1d11..3d5b6a5 100644 (file)
@@ -10,9 +10,7 @@ INCLUDEPATH += ../../shared/
 HEADERS += ../../shared/testhttpserver.h
 SOURCES += ../../shared/testhttpserver.cpp
 
-importFiles.files = data
-importFiles.path = .
-DEPLOYMENT += importFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 QT += core-private gui-private v8-private qml-private network testlib
index baca1e7..3ace6cf 100644 (file)
@@ -6,9 +6,7 @@ SOURCES += tst_qqmllistreference.cpp
 
 include (../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 
index 1773f83..c796b1c 100644 (file)
@@ -6,9 +6,7 @@ SOURCES += tst_qqmllocale.cpp
 
 include (../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 
index b87a7cd..53744d1 100644 (file)
@@ -6,9 +6,7 @@ SOURCES += tst_qqmlmetaobject.cpp
 
 include (../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 QT += qml testlib
index 3d5fe7d..927d802 100644 (file)
@@ -8,12 +8,6 @@ CONFIG -= app_bundle
 
 include (../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
-
-testImportFiles.files = imports
-testImportFiles.path = .
-DEPLOYMENT += testImportFiles
+TESTDATA = data/* imports/*
 
 QT += core-private gui-private qml-private network testlib
index e1b7b39..10e033a 100644 (file)
@@ -7,3 +7,5 @@ SOURCES += tst_qqmlparser.cpp
 DEFINES += SRCDIR=\\\"$$PWD\\\"
 
 CONFIG += parallel_test
+
+cross_compile: DEFINES += QTEST_CROSS_COMPILED
index 5fb5b71..00b64e0 100644 (file)
@@ -182,6 +182,10 @@ void tst_qqmlparser::qmlParser()
 {
     QFETCH(QString, file);
 
+#if defined(QTEST_CROSS_COMPILED)
+    QSKIP("sources not available when cross compiled");
+#endif
+
     using namespace QQmlJS;
 
     QString code;
index 689db4d..6d87890 100644 (file)
@@ -6,9 +6,7 @@ SOURCES += tst_qqmlproperty.cpp
 
 include (../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 
index 890a7e7..92fabf5 100644 (file)
@@ -6,9 +6,7 @@ include (../../shared/util.pri)
 
 macx:CONFIG -= app_bundle
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 
index c17e16b..f784877 100644 (file)
@@ -8,8 +8,6 @@ include (../../shared/util.pri)
 
 CONFIG += parallel_test
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 QT += core-private gui-private v8-private qml-private quick-private sql testlib
index d3f98e1..cad684a 100644 (file)
@@ -7,9 +7,7 @@ RESOURCES += data/translation.qrc
 
 include (../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 
index 6051f65..9155cbe 100644 (file)
@@ -9,9 +9,7 @@ SOURCES += tst_qqmlvaluetypes.cpp \
 
 include (../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 
index ed016fd..8f3b2e0 100644 (file)
@@ -10,9 +10,7 @@ SOURCES += tst_qqmlxmlhttprequest.cpp \
 
 include (../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 
index b87e934..95c82ce 100644 (file)
@@ -6,9 +6,7 @@ SOURCES += tst_qquickbinding.cpp
 
 include (../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 
index bea1f1d..baef334 100644 (file)
@@ -6,9 +6,7 @@ SOURCES += tst_qquickconnection.cpp
 
 include (../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 
index bdf4a45..2726e20 100644 (file)
@@ -6,9 +6,7 @@ SOURCES += tst_qquickfolderlistmodel.cpp
 
 include (../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 QT += core-private gui-private qml-private testlib
index 9b96fa0..25b28bb 100644 (file)
@@ -6,9 +6,7 @@ SOURCES += tst_qquicklistmodel.cpp
 
 include (../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 
index e9c358c..a1b9fdd 100644 (file)
@@ -6,9 +6,7 @@ SOURCES += tst_qquickworkerscript.cpp
 
 include (../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test
 
index df8e7b1..97cd342 100644 (file)
@@ -8,9 +8,7 @@ HEADERS += testtypes.h
 
 include (../../shared/util.pri)
 
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+TESTDATA = data/*
 
 CONFIG += parallel_test