summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/qlibrary/tst/tst.pro3
-rw-r--r--tests/auto/qlibrary/tst_qlibrary.cpp20
2 files changed, 19 insertions, 4 deletions
diff --git a/tests/auto/qlibrary/tst/tst.pro b/tests/auto/qlibrary/tst/tst.pro
index 1ce70cb..e66e859 100644
--- a/tests/auto/qlibrary/tst/tst.pro
+++ b/tests/auto/qlibrary/tst/tst.pro
@@ -2,6 +2,7 @@ load(qttest_p4)
SOURCES += ../tst_qlibrary.cpp
TARGET = ../tst_qlibrary
QT = core
+CONFIG -= app_bundle
win32 {
CONFIG(debug, debug|release) {
@@ -30,5 +31,3 @@ wince*: {
} else {
DEFINES += SRCDIR=\\\"$$PWD/../\\\"
}
-
-win32:CONFIG+=insignificant_test # QTQAINFRA-428
diff --git a/tests/auto/qlibrary/tst_qlibrary.cpp b/tests/auto/qlibrary/tst_qlibrary.cpp
index 3742744..fe2bcd0 100644
--- a/tests/auto/qlibrary/tst_qlibrary.cpp
+++ b/tests/auto/qlibrary/tst_qlibrary.cpp
@@ -165,6 +165,15 @@ tst_QLibrary::tst_QLibrary()
int argc = 1;
app = new QCoreApplication(argc,&argv);
#endif
+#ifdef Q_OS_WIN
+ // cd up from debug/release paths
+ QString directory = QDir::currentPath();
+ if (directory.endsWith(QLatin1String("debug"), Qt::CaseInsensitive)
+ || directory.endsWith(QLatin1String("release"), Qt::CaseInsensitive)) {
+ directory.truncate(directory.lastIndexOf(QLatin1Char('/')));
+ QDir::setCurrent(directory);
+ }
+#endif
}
tst_QLibrary::~tst_QLibrary()
@@ -241,6 +250,13 @@ void tst_QLibrary::load_data()
# endif // Q_OS_UNIX
}
+static inline QByteArray msgCannotLoad(const QString &lib, const QString &why)
+{
+ const QString result = QString::fromLatin1("Cannot load %1 (in %2): %3")
+ .arg(lib, QDir::currentPath(), why);
+ return result.toLatin1();
+}
+
void tst_QLibrary::load()
{
QFETCH( QString, lib );
@@ -249,8 +265,8 @@ void tst_QLibrary::load()
QLibrary library( lib );
bool ok = library.load();
if ( result ) {
- QVERIFY( ok );
- QVERIFY(library.unload());
+ QVERIFY2(ok, msgCannotLoad(lib, library.errorString()));
+ QVERIFY(library.unload());
} else {
QVERIFY( !ok );
}