diff options
author | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-06-09 13:59:07 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-06-09 13:59:07 +0200 |
commit | 0963be63ce741ef6c7585358c3f3b1cb806b66e8 (patch) | |
tree | 6f4964c196b8a52cb15e9efc0388b6a549574460 /src/testlib/qtestcase.cpp | |
parent | 9e6a1351823b3ee3d7e380248f6ef42ff383b014 (diff) | |
parent | eacfbbf64ef90dad8c5cb6b2c812ad64c1100779 (diff) |
Merge remote-tracking branch 'qt/dev' into dev-highdpi
Conflicts:
src/gui/kernel/qsimpledrag.cpp
src/gui/kernel/qwindowsysteminterface.cpp
src/gui/kernel/qwindowsysteminterface_p.h
src/plugins/platforms/xcb/qxcbwindow.cpp
Change-Id: Icd887552ade61d6a2b2527383970f7145aa00faf
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r-- | src/testlib/qtestcase.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index e1e6805a0f..858475f396 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1374,6 +1374,7 @@ static bool installCoverageTool(const char * appname, const char * testname) namespace QTest { static QObject *currentTestObject = 0; + static QString mainSourcePath; class TestFunction { public: @@ -2167,7 +2168,7 @@ static bool qInvokeTestMethod(const char *slotName, const char *data, WatchDog * if (!data || !qstrcmp(data, table.testData(curDataIndex)->dataTag())) { foundFunction = true; - QTestPrivate::checkBlackList(slot, dataCount ? table.testData(curDataIndex)->dataTag() : 0); + QTestPrivate::checkBlackLists(slot, dataCount ? table.testData(curDataIndex)->dataTag() : 0); QTestDataSetter s(curDataIndex >= dataCount ? static_cast<QTestData *>(0) : table.testData(curDataIndex)); @@ -2682,6 +2683,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv) #endif QTestPrivate::parseBlackList(); + QTestPrivate::parseGpuBlackList(); QTestResult::reset(); @@ -3032,6 +3034,13 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co found = candidate; } + // 6. Try main source directory + if (found.isEmpty()) { + QString candidate = QTest::mainSourcePath % QLatin1Char('/') % base; + if (QFileInfo(candidate).exists()) + found = candidate; + } + if (found.isEmpty()) { QTest::qWarn(qPrintable( QString::fromLatin1("testdata %1 could not be located!").arg(base)), @@ -3219,6 +3228,19 @@ QObject *QTest::testObject() } /*! \internal + */ +void QTest::setMainSourcePath(const char *file, const char *builddir) +{ + QString mainSourceFile = QFile::decodeName(file); + QFileInfo fi; + if (builddir) + fi.setFile(QDir(QFile::decodeName(builddir)), mainSourceFile); + else + fi.setFile(mainSourceFile); + QTest::mainSourcePath = fi.absolutePath(); +} + +/*! \internal This function is called by various specializations of QTest::qCompare to decide whether to report a failure and to produce verbose test output. |