Ejemplo n.º 1
0
        private void run(ProcessStartInfo startInfo, bool doNotshellExecute)
        {
            var channel   = Guid.NewGuid().ToString();
            var listener  = startChannelListener(channel);
            var arguments = string.Format("--input=\"{0}\" --output=\"{1}\" --silent --channel=\"{2}\"", _input, _output, channel);

            if (_runInParallel)
            {
                arguments += " --run_assemblies_parallel";
            }
            if (_startSuspended)
            {
                arguments += " --startsuspended";
            }
            if (_compatabilityMode)
            {
                arguments += " --compatibility-mode";
            }
            if (_feedback != null)
            {
                _feedback.ProcessStart(_executable + " " + arguments);
            }
            _proc           = new Process();
            _proc.StartInfo = startInfo;
            if (OS.IsPosix)
            {
                _proc.StartInfo.FileName  = "mono";
                _proc.StartInfo.Arguments = " --debug " + _executable + " " + arguments;
            }
            else
            {
                _proc.StartInfo.FileName  = _executable;
                _proc.StartInfo.Arguments = arguments;
            }
            _proc.StartInfo.WindowStyle      = ProcessWindowStyle.Hidden;
            _proc.StartInfo.UseShellExecute  = !doNotshellExecute;
            _proc.StartInfo.CreateNoWindow   = true;
            _proc.StartInfo.WorkingDirectory = Path.GetDirectoryName(_executable);
            _proc.Start();
            var abortListener = new System.Threading.Thread(listenForAborts);

            abortListener.Start();
            _proc.WaitForExit();
            closeClient();
            if (listener != null)
            {
                listener.Join();
            }
            abortListener.Join();
            if (aborted())
            {
                return;
            }
            var results = getResults(_output);

            TestRunProcess.AddResults(results);
        }
Ejemplo n.º 2
0
        private void run(ProcessStartInfo startInfo)
        {
            var channel   = Guid.NewGuid().ToString();
            var listener  = startChannelListener(channel);
            var arguments = string.Format("--input=\"{0}\" --output=\"{1}\" --silent --channel=\"{2}\"", _input, _output, channel);

            if (_runInParallel)
            {
                arguments += " --run_assemblies_parallel";
            }
            if (_startSuspended)
            {
                arguments += " --startsuspended";
            }
            if (_feedback != null)
            {
                _feedback.ProcessStart(_executable + " " + arguments);
            }
            _proc                                  = new Process();
            _proc.StartInfo                        = startInfo;
            _proc.StartInfo.FileName               = _executable;
            _proc.StartInfo.Arguments              = arguments;
            _proc.StartInfo.WindowStyle            = ProcessWindowStyle.Hidden;
            _proc.StartInfo.RedirectStandardOutput = true;
            _proc.StartInfo.UseShellExecute        = false;
            _proc.StartInfo.CreateNoWindow         = true;
            _proc.StartInfo.WorkingDirectory       = Path.GetDirectoryName(_executable);
            _proc.Start();
            new System.Threading.Thread(listenForAborts).Start();
            _proc.StandardOutput.ReadToEnd();
            _proc.WaitForExit();
            if (aborted())
            {
                listener.Abort();
                return;
            }
            var results = getResults(_output);

            TestRunProcess.AddResults(results);
        }