diff options
author | Alain Martin <ala@ableton.com> | 2014-12-16 14:55:08 +0100 |
---|---|---|
committer | Alain Martin <ala@ableton.com> | 2014-12-17 20:54:40 +0100 |
commit | 7923f9f570e7d765adfea204a0d9dd7c08c0e58f (patch) | |
tree | ded4c0296794b15e010f1baa65af5800a9b2ee25 /src/qmltest/quicktest.cpp | |
parent | 362e1de06d57675db552e60da84c76e42bb5aa31 (diff) |
Add -plugins argument to qmltestrunner to specify plugins search path
Allow users to specify locations of compiled QML plugins.
Change-Id: I66059dc7b1314ca6fbef87032b16ccf3caf8bd30
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qmltest/quicktest.cpp')
-rw-r--r-- | src/qmltest/quicktest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp index bef20c6464..08329bbed7 100644 --- a/src/qmltest/quicktest.cpp +++ b/src/qmltest/quicktest.cpp @@ -215,9 +215,11 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD // Look for QML-specific command-line options. // -import dir Specify an import directory. + // -plugins dir Specify a directory where to search for plugins. // -input dir Specify the input directory for test cases. // -translation file Specify the translation file. QStringList imports; + QStringList pluginPaths; QString testPath; QString translationFile; int index = 1; @@ -228,6 +230,9 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD if (strcmp(argv[index], "-import") == 0 && (index + 1) < argc) { imports += stripQuotes(QString::fromLocal8Bit(argv[index + 1])); index += 2; + } else if (strcmp(argv[index], "-plugins") == 0 && (index + 1) < argc) { + pluginPaths += stripQuotes(QString::fromLocal8Bit(argv[index + 1])); + index += 2; } else if (strcmp(argv[index], "-input") == 0 && (index + 1) < argc) { testPath = stripQuotes(QString::fromLocal8Bit(argv[index + 1])); index += 2; @@ -327,6 +332,8 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD (QLatin1String("qtest"), QTestRootObject::instance()); // Deprecated. Use QTestRootObject from Qt.test.qtestroot instead foreach (const QString &path, imports) view->engine()->addImportPath(path); + foreach (const QString &path, pluginPaths) + view->engine()->addPluginPath(path); foreach (const QString &file, files) { const QFileInfo fi(file); if (!fi.exists()) |