static void Main(string[] args) { if (args.Length != 2) { Environment.Exit(1); } using (PipeStream receivePipe = new AnonymousPipeClientStream(PipeDirection.In, args[0])) using (PipeStream sendPipe = new AnonymousPipeClientStream(PipeDirection.Out, args[1])) using (StreamWriter sendStream = new StreamWriter(sendPipe)) using (StreamReader receiveStream = new StreamReader(receivePipe)) using (new ErrorModeContext(ErrorModes.FailCriticalErrors | ErrorModes.NoGpFaultErrorBox)) { try { var testDescription = TestDescriptionExchanger.ReadATestDescription(receiveStream); RunDescribedTests(testDescription); TestDescriptionExchanger.SendATestDescription(sendStream, testDescription); } catch (Exception) { Environment.Exit(2); } } Environment.Exit(0); }
public TestDescription ReadATest() { var test = TestDescriptionExchanger.ReadATestDescription(_streamIn); _testsReceived++; return(test); }
private static void ReceivingLoop() { using (PipeStream receivePipe = new AnonymousPipeClientStream(PipeDirection.In, _pipeInStringHandler)) using (StreamReader receiveStream = new StreamReader(receivePipe)) { while (!_shouldStop) { var testDescription = TestDescriptionExchanger.ReadATestDescription(receiveStream); _unassignedJobs.Enqueue(testDescription); } } }
static void Main(string[] args) { if (args.Length != 4) { return; } bool oneRunOnly = args[2] == true.ToString(); _killTimeFactor = float.Parse(args[3]); AppDomain.CurrentDomain.UnhandledException += UnexpectedExceptionHandler; try { using (PipeStream receivePipe = new AnonymousPipeClientStream(PipeDirection.In, args[0])) using (PipeStream sendPipe = new AnonymousPipeClientStream(PipeDirection.Out, args[1])) using (StreamWriter sendStream = new StreamWriter(sendPipe)) using (StreamReader receiveStream = new StreamReader(receivePipe)) using (new ErrorModeContext(ErrorModes.FailCriticalErrors | ErrorModes.NoGpFaultErrorBox)) { while (true) { var testDescription = TestDescriptionExchanger.ReadATestDescription(receiveStream); RunDescribedTests(testDescription); TestDescriptionExchanger.SendATestDescription(sendStream, testDescription); if (oneRunOnly) { break; } } } } catch (IOException) { Environment.ExitCode = 1; } catch { Environment.ExitCode = 2; } }
public TestDescription GetTestResult() { return(TestDescriptionExchanger.ReadATestDescription(runnerStreamIn)); }
private TestDescription ReadATest() { var test = TestDescriptionExchanger.ReadATestDescription(_streamIn); return(test); }