parse args earlier
authorCharles Yin <charles.yin@nokia.com>
Mon, 8 Aug 2011 01:35:48 +0000 (11:35 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 8 Aug 2011 01:37:54 +0000 (03:37 +0200)
Change-Id: Ie0869d3f70d1e898a9b0635e28bcad2e92fa607c
Reviewed-on: http://codereview.qt.nokia.com/2718
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Charles Yin <charles.yin@nokia.com>
src/qmltest/quicktest.cpp

index 5b700b3..3164d9e 100644 (file)
@@ -146,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);
@@ -170,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.