public TestRun(TestDescription description, RunningMode runningMode) { this.description = description; Process p = new Process (); p.StartInfo.UseShellExecute = false; p.StartInfo.CreateNoWindow = true; p.StartInfo.RedirectStandardOutput = true; p.EnableRaisingEvents = true; string program = "unhandled-exception-test-case"; if (description.RCIL) { program = program + "-legacy"; } program = program + (description.USE20 ? ".2.exe" : ".1.exe"); if (runningMode.UseMonoRuntime) { p.StartInfo.FileName = runningMode.RUNTIME; p.StartInfo.Arguments = "--debug " + program + " " + description.Arguments; } else { p.StartInfo.FileName = program; p.StartInfo.Arguments = description.Arguments; } Console.WriteLine ("Starting process \"{0}\" \"{1}\"", p.StartInfo.FileName, p.StartInfo.Arguments); p.Start(); string output = p.StandardOutput.ReadToEnd (); p.WaitForExit (); string[] outputLines = output.Split ('\n'); result = new TestResult (p.ExitCode, outputLines); }
public bool Check(TestResult testResult) { if (EXITZERO && (testResult.ExitCode != 0)) { Console.WriteLine ("Test FAILED: exit code is {0}, expected zero", testResult.ExitCode); return false; } if (!CONT && testResult.CONT) { Console.WriteLine ("Test FAILED: unexpected CONT marker found"); return false; } if (CONT && !testResult.CONT) { Console.WriteLine ("Test FAILED: expected CONT marker not found"); return false; } if (!RDUE && testResult.RDUE) { Console.WriteLine ("Test FAILED: unexpected RDUE marker found"); return false; } if (RDUE && !testResult.RDUE) { Console.WriteLine ("Test FAILED: expected RDUE marker not found"); return false; } if (!DDUE && testResult.DDUE) { Console.WriteLine ("Test FAILED: unexpected marker found"); return false; } if (DDUE && !testResult.DDUE) { Console.WriteLine ("Test FAILED: expected DDUE marker not found"); return false; } return true; }