[System.Web] Fix standalone-runner to return non-zero exit code on failure (#4562)
[mono.git] / mcs / class / System.Web / Test / tools / standalone-runner.cs
index d3de824333210066dc1a22e8d5dde570c31aaf78..e8f05421b5fbc6458357012280d1951874033656 100644 (file)
@@ -73,13 +73,16 @@ namespace StandAloneRunner
                static void Main (string[] args)
                {
                        try {
-                               Run (args);
+                               var success = Run (args);
+
+                               if (!success)
+                                       Environment.Exit (1);
                        } catch (Exception ex) {
                                Die ("Exception caught:{0}{1}", Environment.NewLine, ex.ToString ());
                        }
                }
 
-               static void Run (string[] args)
+               static bool Run (string[] args)
                {
                        bool showHelp = false;
                        string testName = null;
@@ -177,6 +180,8 @@ namespace StandAloneRunner
                                        writer.Dispose ();
                                }
                        }
+
+                       return failedCounter == 0;
                }
 
                static string FormatReport (StandaloneTest test)