public async Task CorrectlyConnectOutputPipes()
        {
            {
                var si = new ProcessPipelineStartInfo()
                {
                    StdOutputRedirection = OutputRedirection.OutputPipe,
                    StdErrorRedirection  = OutputRedirection.ErrorPipe,
                };
                si.Add(TestUtil.TestChildPath, "EchoOutAndError");
                si.Add(TestUtil.TestChildPath, "EchoBack");
                si.Add(TestUtil.TestChildPath, "EchoBack");

                using (var sut = ProcessPipeline.Start(si))
                {
                    await ChildProcessAssert.CorrectlyConnectsPipesAsync(sut, "TestChild.Out", "TestChild.Error");
                }
            }

            {
                // invert stdout and stderr
                var si = new ProcessPipelineStartInfo()
                {
                    StdOutputRedirection = OutputRedirection.ErrorPipe,
                    StdErrorRedirection  = OutputRedirection.OutputPipe,
                };
                si.Add(TestUtil.TestChildPath, "EchoOutAndError");
                si.Add(TestUtil.TestChildPath, "EchoBack");
                si.Add(TestUtil.TestChildPath, "EchoBack");

                using (var sut = ProcessPipeline.Start(si))
                {
                    await ChildProcessAssert.CorrectlyConnectsPipesAsync(sut, "TestChild.Error", "TestChild.Out");
                }
            }
        }
 public async Task CanCancelWaitForExitAsync()
 {
     using (var sut = CreateForWaitForExitTest())
     {
         await ChildProcessAssert.CanCancelWaitForExitAsync(sut);
     }
 }
        public void CanCreateChildProcess()
        {
            {
                var si = new ProcessPipelineStartInfo()
                {
                    StdOutputRedirection = OutputRedirection.OutputPipe,
                };
                si.Add(TestUtil.TestChildPath);

                using (var sut = ProcessPipeline.Start(si))
                {
                    ChildProcessAssert.CanCreateChildProcess(sut);
                }
            }

            {
                var si = new ProcessPipelineStartInfo()
                {
                    StdOutputRedirection = OutputRedirection.OutputPipe,
                };
                si.Add(TestUtil.TestChildPath);
                si.Add(TestUtil.TestChildPath, "EchoBack");

                using (var sut = ProcessPipeline.Start(si))
                {
                    ChildProcessAssert.CanCreateChildProcess(sut);
                }
            }
        }
 public async Task WaitForExitAsyncTimesOut()
 {
     using (var sut = CreateForWaitForExitTest())
     {
         await ChildProcessAssert.WaitForExitAsyncTimesOut(sut);
     }
 }
 public void WaitForExitTimesOut()
 {
     using (var sut = CreateForWaitForExitTest())
     {
         ChildProcessAssert.WaitForExitTimesOut(sut);
     }
 }
Example #6
0
        public async Task CorrectlyConnectOutputPipes()
        {
            {
                var si = new ChildProcessStartInfo(TestUtil.DotnetCommand, TestUtil.TestChildPath, "EchoOutAndError")
                {
                    StdOutputRedirection = OutputRedirection.OutputPipe,
                    StdErrorRedirection  = OutputRedirection.ErrorPipe,
                };

                using (var sut = ChildProcess.Start(si))
                {
                    await ChildProcessAssert.CorrectlyConnectsPipesAsync(sut, "TestChild.Out", "TestChild.Error");
                }
            }

            {
                // invert stdout and stderr
                var si = new ChildProcessStartInfo(TestUtil.DotnetCommand, TestUtil.TestChildPath, "EchoOutAndError")
                {
                    StdOutputRedirection = OutputRedirection.ErrorPipe,
                    StdErrorRedirection  = OutputRedirection.OutputPipe,
                };

                using (var sut = ChildProcess.Start(si))
                {
                    await ChildProcessAssert.CorrectlyConnectsPipesAsync(sut, "TestChild.Error", "TestChild.Out");
                }
            }
        }
Example #7
0
        public void CanCreateChildProcess()
        {
            var si = new ChildProcessStartInfo(TestUtil.DotnetCommand, TestUtil.TestChildPath)
            {
                StdOutputRedirection = OutputRedirection.OutputPipe,
            };

            using (var sut = ChildProcess.Start(si))
            {
                ChildProcessAssert.CanCreateChildProcess(sut);
            }
        }
Example #8
0
        public async Task PipesAreAsynchronous()
        {
            var si = new ChildProcessStartInfo(TestUtil.DotnetCommand, TestUtil.TestChildPath, "EchoBack")
            {
                StdInputRedirection  = InputRedirection.InputPipe,
                StdOutputRedirection = OutputRedirection.OutputPipe,
                StdErrorRedirection  = OutputRedirection.ErrorPipe,
            };

            using (var sut = ChildProcess.Start(si))
            {
                await ChildProcessAssert.PipesAreAsynchronousAsync(sut);
            }
        }
        public async Task PipesAreAsynchronous()
        {
            var si = new ProcessPipelineStartInfo()
            {
                StdInputRedirection  = InputRedirection.InputPipe,
                StdOutputRedirection = OutputRedirection.OutputPipe,
                StdErrorRedirection  = OutputRedirection.ErrorPipe,
            };

            si.Add(TestUtil.TestChildPath, "EchoBack");
            si.Add(TestUtil.TestChildPath, "EchoBack");
            si.Add(TestUtil.TestChildPath, "EchoBack");

            using (var sut = ProcessPipeline.Start(si))
            {
                await ChildProcessAssert.PipesAreAsynchronousAsync(sut);
            }
        }