aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmltest
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2011-08-25 11:47:24 +0200
committerGunnar Sletta <gunnar.sletta@nokia.com>2011-08-25 12:52:15 +0200
commit8e6ecb56e5d61ce661422779c9d9cbf22f081a34 (patch)
tree227aeb360800a49de58472bd39bc5f4c596c1b15 /src/qmltest
parentc9224b6cf5cceb7d5314f7504d44bfe72bc66950 (diff)
parent0d84e957297b4ffa6ab5b0b5bcf8b169d567d298 (diff)
Merge branch 'master' into refactor
Conflicts: src/declarative/items/qsgcanvas.cpp src/declarative/items/qsgitem.cpp src/declarative/items/qsgtextnode.cpp tests/auto/declarative/examples/examples.pro tools/qmlviewer/qmlviewer.pro Change-Id: Icbb0ef5dc79b658c62fd2b2c25a66c9bb3cbeb10
Diffstat (limited to 'src/qmltest')
-rw-r--r--src/qmltest/quicktest.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp
index 3f0c5325ed..3164d9ec06 100644
--- a/src/qmltest/quicktest.cpp
+++ b/src/qmltest/quicktest.cpp
@@ -110,7 +110,10 @@ static inline QString stripQuotes(const QString &s)
int quick_test_main(int argc, char **argv, const char *name, quick_test_viewport_create createViewport, const char *sourceDir)
{
- QApplication app(argc, argv);
+ QApplication* app = 0;
+ if (!QCoreApplication::instance()) {
+ app = new QApplication(argc, argv);
+ }
// Look for QML-specific command-line options.
// -import dir Specify an import directory.
@@ -143,6 +146,10 @@ int quick_test_main(int argc, char **argv, const char *name, quick_test_viewport
argv[outargc] = 0;
argc = outargc;
+ // Parse the command-line arguments.
+ QuickTestResult::parseArgs(argc, argv);
+ QuickTestResult::setProgramName(name);
+
// Determine where to look for the test data.
if (testPath.isEmpty() && sourceDir)
testPath = QString::fromLocal8Bit(sourceDir);
@@ -167,9 +174,6 @@ int quick_test_main(int argc, char **argv, const char *name, quick_test_viewport
return 1;
}
- // Parse the command-line arguments.
- QuickTestResult::parseArgs(argc, argv);
- QuickTestResult::setProgramName(name);
// Scan through all of the "tst_*.qml" files and run each of them
// in turn with a QDeclarativeView.
@@ -287,6 +291,7 @@ int quick_test_main(int argc, char **argv, const char *name, quick_test_viewport
// Flush the current logging stream.
QuickTestResult::setProgramName(0);
+ delete app;
// Return the number of failures as the exit code.
return QuickTestResult::exitCode();
}