Exemple #1
0
        public static void RunTestInNewProcess(string fixtureName, string testName)
        {
            var procStart = new ProcessStartInfo
            {
                FileName               = typeof(TestUtils).Assembly.Location,
                Arguments              = fixtureName + " " + testName,
                CreateNoWindow         = true,
                UseShellExecute        = false,
                RedirectStandardOutput = true,
                RedirectStandardError  = true
            };

            var proc = System.Diagnostics.Process.Start(procStart);

            Assert.IsNotNull(proc);

            try
            {
                IgniteProcess.AttachProcessConsoleReader(proc);

                Assert.IsTrue(proc.WaitForExit(19000));
                Assert.AreEqual(0, proc.ExitCode);
            }
            finally
            {
                if (!proc.HasExited)
                {
                    proc.Kill();
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Runs the client process.
        /// </summary>
        private static void RunClientProcess(string exePath)
        {
            var procStart = new ProcessStartInfo
            {
                FileName               = exePath,
                CreateNoWindow         = true,
                UseShellExecute        = false,
                RedirectStandardOutput = true,
                RedirectStandardError  = true,
            };

            var proc = Process.Start(procStart);

            Assert.IsNotNull(proc);

            IgniteProcess.AttachProcessConsoleReader(proc);

            Assert.IsTrue(proc.WaitForExit(30000));
            Assert.AreEqual(0, proc.ExitCode);

            File.Delete(exePath);
        }