Add command line flag to DRT to output the number of tests completed in server mode.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Feb 2016 23:40:39 +0000 (23:40 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Feb 2016 23:40:39 +0000 (23:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=153750

Reviewed by Darin Adler.

* DumpRenderTree/mac/DumpRenderTree.mm:
(initializeGlobalsFromCommandLineOptions):
(runTestingServerLoop):

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

Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm

index a69da1c..dc748b1 100644 (file)
@@ -1,3 +1,14 @@
+2016-02-01  Brady Eidson  <beidson@apple.com>
+
+        Add command line flag to DRT to output the number of tests completed in server mode.
+        https://bugs.webkit.org/show_bug.cgi?id=153750
+
+        Reviewed by Darin Adler.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (initializeGlobalsFromCommandLineOptions):
+        (runTestingServerLoop):
+
 2016-02-01  Jason Marcell  <jmarcell@apple.com>
 
         Improvements to botwatcher's dashboard unit tests.
index e027bde..85797be 100644 (file)
@@ -206,6 +206,7 @@ static int forceComplexText;
 static int useAcceleratedDrawing;
 static int gcBetweenTests;
 static int showWebView = NO;
+static int printTestCount = NO;
 static BOOL printSeparators;
 static RetainPtr<CFStringRef> persistentUserStyleSheetLocation;
 static std::set<std::string> allowedHosts;
@@ -1140,6 +1141,7 @@ static void initializeGlobalsFromCommandLineOptions(int argc, const char *argv[]
         {"no-timeout", no_argument, &useTimeoutWatchdog, NO},
         {"allowed-host", required_argument, nullptr, 'a'},
         {"show-webview", no_argument, &showWebView, YES},
+        {"print-test-count", no_argument, &printTestCount, YES},
         {nullptr, 0, nullptr, 0}
     };
     
@@ -1177,6 +1179,7 @@ static void runTestingServerLoop()
     // When DumpRenderTree run in server mode, we just wait around for file names
     // to be passed to us and read each in turn, passing the results back to the client
     char filenameBuffer[2048];
+    unsigned testCount = 0;
     while (fgets(filenameBuffer, sizeof(filenameBuffer), stdin)) {
         char *newLineCharacter = strchr(filenameBuffer, '\n');
         if (newLineCharacter)
@@ -1186,6 +1189,11 @@ static void runTestingServerLoop()
             continue;
 
         runTest(filenameBuffer);
+
+        if (printTestCount) {
+            ++testCount;
+            printf("\nServer mode has completed %u tests.\n\n", testCount);
+        }
     }
 }