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); }
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; } }
private static void SendingLoop() { using (PipeStream sendPipe = new AnonymousPipeClientStream(PipeDirection.Out, _pipeOutStringHandler)) using (StreamWriter sendStream = new StreamWriter(sendPipe)) { while (true) { while (_completedJobs.IsEmpty && !_shouldStop) { Thread.Sleep(SENDING_JOBCHECK_COOLDOWN_MS); } if (_shouldStop && _completedJobs.IsEmpty) { break; } TestDescription testDescriptionToSend; if (!_completedJobs.TryDequeue(out testDescriptionToSend)) { continue; } TestDescriptionExchanger.SendATestDescription(sendStream, testDescriptionToSend); } } }
public void SendTest(TestDescription test) { TestDescriptionExchanger.SendATestDescription(_streamOut, test); _testsSended++; }
public void SendJob(TestDescription job) { TestDescriptionExchanger.SendATestDescription(runnerStreamOut, job); }
private void SendTest(TestDescription test) { TestDescriptionExchanger.SendATestDescription(_streamOut, test); }