public void Execute()
{
var pf = System.Environment.OSVersion.Platform;
var isUnix = pf == PlatformID.Unix || pf == PlatformID.MacOSX;
var processInfo = new ProcessStartInfo
{
FileName = _directory.AppendPath("BottleServiceRunner.exe"),
WorkingDirectory = _directory,
//RedirectStandardError = true,
//RedirectStandardInput = true,
//RedirectStandardOutput = true,
//CreateNoWindow = true,
UseShellExecute = false
};
if (isUnix)
{
processInfo = new ProcessStartInfo
{
FileName = "/usr/bin/xterm",
WorkingDirectory = _directory,
Arguments = string.Format("-e '/usr/bin/mono {0}'", _directory.AppendPath("BottleServiceRunner.exe")),
//RedirectStandardError = true,
//RedirectStandardInput = true,
//RedirectStandardOutput = true,
//CreateNoWindow = true,
UseShellExecute = false
};
}
var process = Process.Start(processInfo);
//Console.WriteLine(process.StandardOutput.ReadToEnd());
_checker.WaitForActivated();
// need to type CTRL-C here
_checker.WaitForDeactivated();
if (_checker.Messages.Any())
{
_checker.Messages.Each(x => Debug.WriteLine(x));
Assert.Fail("Stuff didn't work, see the above messages");
}
}