WebKitTestRunner: Provide usage if run without arguments
authorvestbo@webkit.org <vestbo@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Sep 2011 12:34:51 +0000 (12:34 +0000)
committervestbo@webkit.org <vestbo@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Sep 2011 12:34:51 +0000 (12:34 +0000)
If WTR is run without either one or more filenames, or
a '-' to indicate server mode, we don't need to start
up the test machinery. Doing so might actually crash,
as we'll exit the application immedeatly after anyways.

Reviewed by Simon Hausmann.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95532 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/WebKitTestRunner/TestController.cpp

index 70eacdf..fd7027b 100644 (file)
@@ -1,5 +1,19 @@
 2011-09-20  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
 
+        WebKitTestRunner: Provide usage if run without arguments
+
+        If WTR is run without either one or more filenames, or
+        a '-' to indicate server mode, we don't need to start
+        up the test machinery. Doing so might actually crash,
+        as we'll exit the application immedeatly after anyways.
+
+        Reviewed by Simon Hausmann.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::initialize):
+
+2011-09-20  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
         [Qt] Don't use QFont before initializing QApplication
 
         Could potentially result in crash.
index 141834b..948ea30 100644 (file)
@@ -211,6 +211,13 @@ void TestController::initialize(int argc, const char* argv[])
 {
     platformInitialize();
 
+    if (argc < 2) {
+        fputs("Usage: WebKitTestRunner [options] filename [filename2..n]\n", stderr);
+        // FIXME: Refactor option parsing to allow us to print
+        // an auto-generated list of options.
+        exit(1);
+    }
+
     bool printSupportedFeatures = false;
 
     for (int i = 1; i < argc; ++i) {