[ros-diffs] [fireball] 47707: [SYSREG3] - Print a message if maximum number of retries is exceeded. - Stop executing if ProcessDebugOutput asked so. - Report stopping reason to console.

fireball at svn.reactos.org fireball at svn.reactos.org
Wed Jun 9 09:12:08 CET 2010


Author: fireball
Date: Wed Jun  9 11:12:07 2010
New Revision: 47707

URL: http://svn.reactos.org/svn/reactos?rev=47707&view=rev
Log:
[SYSREG3]
- Print a message if maximum number of retries is exceeded.
- Stop executing if ProcessDebugOutput asked so.
- Report stopping reason to console.

Modified:
    trunk/tools/sysreg3/Program.cs

Modified: trunk/tools/sysreg3/Program.cs
URL: http://svn.reactos.org/svn/reactos/trunk/tools/sysreg3/Program.cs?rev=47707&r1=47706&r2=47707&view=diff
==============================================================================
--- trunk/tools/sysreg3/Program.cs [iso-8859-1] (original)
+++ trunk/tools/sysreg3/Program.cs [iso-8859-1] Wed Jun  9 11:12:07 2010
@@ -22,7 +22,7 @@
         string machineName = "ReactOS";
         int maxRetries = 3;
         int numStages = 3;
-        int vmTimeout = 5 * 1000; // 120 secs
+        int vmTimeout = 30 * 1000; // 120 secs
 
         IMachine rosVM;
         IVirtualBox vBox;
@@ -73,7 +73,7 @@
                         if (waitingTime >= vmTimeout)
                         {
                             /* We hit the timeout, quit */
-                            Console.WriteLine("[SYSREG] Timeout");
+                            Console.WriteLine("[SYSREG] timeout");
                             Result = ContinueType.EXIT_CONTINUE;
                             quitLoop = true;
                             break;
@@ -147,6 +147,7 @@
 
         public void RunTests()
         {
+            ContinueType Ret = ContinueType.EXIT_DONT_CONTINUE;
             IProgress vmProgress;
 
             // TODO: Load settings
@@ -188,7 +189,8 @@
             /* Start main testing loop */
             for (int stage = 0; stage < numStages; stage++)
             {
-                for (int retries = 0; retries < maxRetries; retries++)
+                int retries;
+                for (retries = 0; retries < maxRetries; retries++)
                 {
                     /* Start the VM */
                     try
@@ -210,7 +212,7 @@
                         Console.WriteLine("[SYSREG] Running stage {0}...", stage + 1);
                         Console.WriteLine("[SYSREG] Domain {0} started.\n", rosVM.Name);
 
-                        ContinueType Ret = ProcessDebugOutput(vmSession, stage);
+                        Ret = ProcessDebugOutput(vmSession, stage);
 
                         /* Kill the VM */
                         vmProgress = vmSession.Console.PowerDown();
@@ -229,14 +231,33 @@
                     }
                     catch (Exception exc)
                     {
-                        Console.WriteLine("Running the VM failed with exception: " + exc.ToString());
+                        Console.WriteLine("[SYSREG] Running the VM failed with exception: " + exc.ToString());
                         break;
                     }
-
-                    break;
                 }
 
-                break;
+                /* Check for a maximum number of retries */
+                if (retries == maxRetries)
+                {
+                    Console.WriteLine("[SYSREG] Maximum number of allowed retries exceeded, aborting!");
+                    break;
+                }
+
+                /* Stop executing if asked so */
+                if (Ret == ContinueType.EXIT_DONT_CONTINUE) break;
+            }
+
+            switch (Ret)
+            {
+                case ContinueType.EXIT_CHECKPOINT_REACHED:
+                    Console.WriteLine("[SYSREG] Status: Reached the checkpoint!");
+                    break;
+                case ContinueType.EXIT_CONTINUE:
+                    Console.WriteLine("[SYSREG] Status: Failed to reach the checkpoint!!");
+                    break;
+                case ContinueType.EXIT_DONT_CONTINUE:
+                    Console.WriteLine("[SYSREG] Status: Testing process aborted!");
+                    break;
             }
         }
     }




More information about the Ros-diffs mailing list