summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2011-11-24 10:36:10 +1000
committerQt by Nokia <qt-info@nokia.com>2011-12-01 09:12:52 +0100
commit3385fb91e1e55e1bfa1f78dfb8ce2e9f3fdaedef (patch)
treeb77bb527bf3a21dc95a317248b2640c73751f629 /tests/auto/corelib/kernel
parent13eba9ddf47d570fc4562c20fcfbacd1dfa4a61a (diff)
Fixed installation of corelib tests
In .pro files, removed wince/symbian-specific DEPLOYMENT cases and replaced them with TESTDATA where appropriate. In .cpp files, removed SRCDIR and relative paths to testdata and replaced them with the QFINDTESTDATA macro where appropriate. Modified test helper apps/libs to install themselves under the test they relate to. This change allows corelib tests to be correctly installed, along with their testdata, via `make install'. Change-Id: I5e202e2f3b577af7e39072d5c9fe13e0ca125304 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Diffstat (limited to 'tests/auto/corelib/kernel')
-rw-r--r--tests/auto/corelib/kernel/qitemmodel/qitemmodel.pro11
-rw-r--r--tests/auto/corelib/kernel/qobject/signalbug.pro8
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp3
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.pro6
-rw-r--r--tests/auto/corelib/kernel/qtranslator/qtranslator.pro6
-rw-r--r--tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp15
6 files changed, 19 insertions, 30 deletions
diff --git a/tests/auto/corelib/kernel/qitemmodel/qitemmodel.pro b/tests/auto/corelib/kernel/qitemmodel/qitemmodel.pro
index 9df1364d36..ff21d6afa5 100644
--- a/tests/auto/corelib/kernel/qitemmodel/qitemmodel.pro
+++ b/tests/auto/corelib/kernel/qitemmodel/qitemmodel.pro
@@ -2,14 +2,3 @@ CONFIG += testcase
TARGET = tst_qitemmodel
QT += widgets sql testlib
SOURCES = tst_qitemmodel.cpp
-
-# NOTE: The deployment of the sqldrivers is disabled on purpose.
-# If we deploy the plugins, they are loaded twice when running
-# the tests on the autotest system. In that case we run out of
-# memory on Windows Mobile 5.
-
-#wince*: {
-# plugFiles.files = $$QT_BUILD_TREE/plugins/sqldrivers/*.dll
-# plugFiles.path = sqldrivers
-# DEPLOYMENT += plugFiles
-#}
diff --git a/tests/auto/corelib/kernel/qobject/signalbug.pro b/tests/auto/corelib/kernel/qobject/signalbug.pro
index a835264a93..ed3adf0242 100644
--- a/tests/auto/corelib/kernel/qobject/signalbug.pro
+++ b/tests/auto/corelib/kernel/qobject/signalbug.pro
@@ -1,7 +1,3 @@
-######################################################################
-# Automatically generated by qmake (2.01a) Tue Aug 15 13:45:41 2006
-######################################################################
-
TEMPLATE = app
TARGET =
DEPENDPATH += .
@@ -16,4 +12,6 @@ wince*: {
HEADERS += signalbug.h
SOURCES += signalbug.cpp
-
+# This app is testdata for tst_qobject
+target.path = $$[QT_INSTALL_TESTS]/tst_qobject
+INSTALLS += target
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index 1b5e3bd79e..b20b98da54 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -2796,7 +2796,8 @@ void tst_QObject::dynamicProperties()
void tst_QObject::recursiveSignalEmission()
{
QProcess proc;
- proc.start("./signalbug");
+ // signalbug helper app should always be next to this test binary
+ proc.start(QCoreApplication::applicationDirPath() + "/signalbug");
QVERIFY(proc.waitForFinished());
QVERIFY(proc.exitStatus() == QProcess::NormalExit);
QCOMPARE(proc.exitCode(), 0);
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.pro b/tests/auto/corelib/kernel/qobject/tst_qobject.pro
index bbc02ce34d..e13852629c 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.pro
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.pro
@@ -6,9 +6,3 @@ SOURCES = tst_qobject.cpp
# this is here for a reason, moc_oldnormalizedobject.cpp is not auto-generated, it was generated by
# moc from Qt 4.6, and should *not* be generated by the current moc
SOURCES += moc_oldnormalizeobject.cpp
-
-wince* {
- addFiles.files = signalbug.exe
- addFiles.path = .
- DEPLOYMENT += addFiles
-}
diff --git a/tests/auto/corelib/kernel/qtranslator/qtranslator.pro b/tests/auto/corelib/kernel/qtranslator/qtranslator.pro
index f44be7df80..c644f83a22 100644
--- a/tests/auto/corelib/kernel/qtranslator/qtranslator.pro
+++ b/tests/auto/corelib/kernel/qtranslator/qtranslator.pro
@@ -4,8 +4,4 @@ QT += widgets testlib
SOURCES = tst_qtranslator.cpp
RESOURCES += qtranslator.qrc
-wince* {
- addFiles.files = hellotr_la.qm msgfmt_from_po.qm
- addFiles.path = .
- DEPLOYMENT += addFiles
-}
+TESTDATA += hellotr_la.qm msgfmt_from_po.qm
diff --git a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp
index 5908c335c2..f47c02f93d 100644
--- a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp
+++ b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp
@@ -56,6 +56,8 @@ public:
protected:
bool event(QEvent *event);
private slots:
+ void initTestCase();
+
void load();
void load2();
void threadLoad();
@@ -76,6 +78,14 @@ tst_QTranslator::tst_QTranslator()
hide();
}
+void tst_QTranslator::initTestCase()
+{
+ // chdir into the directory containing our testdata,
+ // to make the code simpler (load testdata via relative paths)
+ QString testdata_dir = QFileInfo(QFINDTESTDATA("hellotr_la.qm")).absolutePath();
+ QVERIFY2(QDir::setCurrent(testdata_dir), qPrintable("Could not chdir to " + testdata_dir));
+}
+
bool tst_QTranslator::event(QEvent *event)
{
if (event->type() == QEvent::LanguageChange)
@@ -228,10 +238,11 @@ void tst_QTranslator::loadFromResource()
void tst_QTranslator::loadDirectory()
{
- QVERIFY(QFileInfo("../qtranslator").isDir());
+ QString current_base = QDir::current().dirName();
+ QVERIFY(QFileInfo("../" + current_base).isDir());
QTranslator tor;
- tor.load("qtranslator", "..");
+ tor.load(current_base, "..");
QVERIFY(tor.isEmpty());
}