Skip to content

Commit

Permalink
Only attempt to load QML test cases from source directory if it exists.
Browse files Browse the repository at this point in the history
When running installed unit tests the QML test cases are likely not
in the source directory, but in the same directory as the installed
test binary.  If the source directory does not exist, fall back to
searching for QML test cases in the current directory.

Change-Id: I231b9cd49b12d88dd6cfbcc8dfb8b6c2c69d5aad
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
  • Loading branch information
Aaron McCarthy authored and Qt by Nokia committed Mar 13, 2012
1 parent 656d1a1 commit 340c479
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/qmltest/quicktest.cpp
Expand Up @@ -203,8 +203,11 @@ int quick_test_main(int argc, char **argv, const char *name, quick_test_viewport
}

// Determine where to look for the test data.
if (testPath.isEmpty() && sourceDir)
testPath = QString::fromLocal8Bit(sourceDir);
if (testPath.isEmpty() && sourceDir) {
const QString s = QString::fromLocal8Bit(sourceDir);
if (QFile::exists(s))
testPath = s;
}
if (testPath.isEmpty()) {
QDir current = QDir::current();
#ifdef Q_OS_WIN
Expand Down

0 comments on commit 340c479

Please sign in to comment.