0

In the main method I want to start a process which is to run some test cases, and when the process returns I want to know how many test cases failed. In this case, I want the process to be able to return a value to the main process after it is done executing. Is there a way to do this? My code is like below:

 ProcessStartInfo processInfo = new ProcessStartInfo(exeFilePath, Parser.Default.FormatCommandLine(options));
 var p = Process.Start(processInfo);
 // need to get the number of failed test cases from the process

Any help is appreciated.

flyingbee
  • 601
  • 1
  • 7
  • 17
  • There are different ways to get the process output. What matters is whether the values need be returned synchronously or asynchronously. Take a look a [this](https://stackoverflow.com/questions/51680382/how-do-i-get-output-from-a-command-to-appear-in-a-control-on-a-form-in-real-time?answertab=active#tab-top) (read the description). If you need a hand to implement something like this it in you context, comment back. – Jimi Aug 11 '18 at 10:58
  • 1
    Thanks Jimi! I tried the solution. It works for me! – flyingbee Aug 13 '18 at 16:24

0 Answers0