diff options
author | Kurt Korbatits <kurt.korbatits@nokia.com> | 2012-01-25 11:29:16 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-31 04:55:38 +0100 |
commit | c8f88e6292c155c431cf8eb8657e46717c862eb0 (patch) | |
tree | 664d01f8f76e49bf2240f29d5847828130ba541e /tests | |
parent | 4ca298f42bfdc908815cca06236827e5158a5f67 (diff) |
Changed qapplication unittest to work from installation directory
- Changed to use TESTDATA and installTestHelperApp()
- Changed to use QFINDTESTDATA instead of currentPath()
Change-Id: Ia24ebc758d5d0fdfcca951500766adefbcf9fe93
Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests')
6 files changed, 18 insertions, 25 deletions
diff --git a/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/desktopsettingsaware.pro b/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/desktopsettingsaware.pro index 3aa363d796..3b229e31cb 100644 --- a/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/desktopsettingsaware.pro +++ b/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/desktopsettingsaware.pro @@ -13,6 +13,3 @@ SOURCES += main.cpp CONFIG += qt warn_on create_prl link_prl CONFIG -= app_bundle -# This app is testdata for tst_qapplication -target.path = $$[QT_INSTALL_TESTS]/tst_qapplication/$$TARGET -INSTALLS += target diff --git a/tests/auto/widgets/kernel/qapplication/modal/modal.pro b/tests/auto/widgets/kernel/qapplication/modal/modal.pro index b13165bcda..d9489928ba 100644 --- a/tests/auto/widgets/kernel/qapplication/modal/modal.pro +++ b/tests/auto/widgets/kernel/qapplication/modal/modal.pro @@ -8,6 +8,3 @@ DESTDIR = ./ CONFIG -= app_bundle HEADERS += base.h -# This app is testdata for tst_qapplication -target.path = $$[QT_INSTALL_TESTS]/tst_qapplication/$$TARGET -INSTALLS += target diff --git a/tests/auto/widgets/kernel/qapplication/qapplication.pro b/tests/auto/widgets/kernel/qapplication/qapplication.pro index becc6c6f4b..5f369bf61a 100644 --- a/tests/auto/widgets/kernel/qapplication/qapplication.pro +++ b/tests/auto/widgets/kernel/qapplication/qapplication.pro @@ -1,7 +1,7 @@ TEMPLATE = subdirs -SUBDIRS = test \ - desktopsettingsaware \ - modal \ - wincmdline +SUBDIRS = desktopsettingsaware modal +win32:!wince*:SUBDIRS += wincmdline +test.depends += $$SUBDIRS +SUBDIRS += test diff --git a/tests/auto/widgets/kernel/qapplication/test/test.pro b/tests/auto/widgets/kernel/qapplication/test/test.pro index db9d59bdf6..9f6db3cd3e 100644 --- a/tests/auto/widgets/kernel/qapplication/test/test.pro +++ b/tests/auto/widgets/kernel/qapplication/test/test.pro @@ -6,14 +6,6 @@ QT += core-private gui-private SOURCES += ../tst_qapplication.cpp TARGET = ../tst_qapplication -wince* { - additional.files = ../desktopsettingsaware/desktopsettingsaware.exe - additional.path = desktopsettingsaware - someTest.files = test.pro - someTest.path = test - DEPLOYMENT += additional deploy someTest -} - win32 { CONFIG(debug, debug|release) { TARGET = ../../debug/tst_qapplication @@ -23,3 +15,13 @@ win32 { } mac*:CONFIG+=insignificant_test + +TESTDATA = ../test/test.pro ../tmp/README + +SUBPROGRAMS = desktopsettingsaware modal +win32: !wince*: SUBPROGRAMS += wincmdline + +load(testcase) # for target.path and installTestHelperApp() +for(file, SUBPROGRAMS): installTestHelperApp("../$${file}/$${file}",$${file},$${file}) + + diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index 7431ff255a..ac8f2a34ce 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -815,7 +815,7 @@ void tst_QApplication::libraryPaths() { { #ifndef Q_OS_WINCE - QString testDir = QDir::current().canonicalPath() + "/test"; + QString testDir = QFileInfo(QFINDTESTDATA("test/test.pro")).absolutePath(); #else // On Windows CE we need QApplication object to have valid // current Path. Therefore we need to identify it ourselves @@ -861,7 +861,7 @@ void tst_QApplication::libraryPaths() "\nexpected:\n - " + expected.join("\n - "))); // setting the library paths overrides everything - QString testDir = QDir::currentPath() + "/test"; + QString testDir = QFileInfo(QFINDTESTDATA("test/test.pro")).absolutePath(); QApplication::setLibraryPaths(QStringList() << testDir); QVERIFY2(isPathListIncluded(QApplication::libraryPaths(), (QStringList() << testDir)), qPrintable("actual:\n - " + QApplication::libraryPaths().join("\n - ") + @@ -884,8 +884,8 @@ void tst_QApplication::libraryPaths() qDebug() << "After adding plugins path:" << QApplication::libraryPaths(); #endif QCOMPARE(QApplication::libraryPaths().count(), count); - - QApplication::addLibraryPath(QDir::currentPath() + "/test"); + QString testDir = QFileInfo(QFINDTESTDATA("test/test.pro")).absolutePath(); + QApplication::addLibraryPath(testDir); QCOMPARE(QApplication::libraryPaths().count(), count + 1); // creating QApplication adds the applicationDirPath to the libraryPath diff --git a/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro b/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro index 9abeb1cc83..8498d8b31d 100644 --- a/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro +++ b/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro @@ -5,6 +5,3 @@ QT += widgets SOURCES += main.cpp DESTDIR = ./ -# This app is testdata for tst_qapplication -target.path = $$[QT_INSTALL_TESTS]/tst_qapplication/$$TARGET -INSTALLS += target |