Skip to content

Commit

Permalink
[iOS] Stop passing mlaunch output to stderr of XHarness CLI (#211)
Browse files Browse the repository at this point in the history
Fixes: #108
  • Loading branch information
premun authored May 18, 2020
1 parent 5b18dd8 commit 71d0337
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 38 deletions.
37 changes: 0 additions & 37 deletions src/Microsoft.DotNet.XHarness.iOS/AppRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,24 +231,6 @@ public AppRunner(IMLaunchProcessManager processManager,

deviceName = simulator.Name;

string? stdoutLogPath = null, stderrLogPath = null;

if (!target.IsWatchOSTarget())
{
var stderrTty = _helpers.GetTerminalName(2);
if (!string.IsNullOrEmpty(stderrTty))
{
args.Add(new SetStderrArgument(stderrTty));
}
else
{
stdoutLogPath = _logs.CreateFile($"mlaunch-stdout-{_helpers.Timestamp}.log", "Standard output");
stderrLogPath = _logs.CreateFile($"mlaunch-stderr-{_helpers.Timestamp}.log", "Standard error");
args.Add(new SetStdoutArgument(stdoutLogPath));
args.Add(new SetStderrArgument(stderrLogPath));
}
}

var systemLogs = new List<ICaptureLog>();
foreach (var sim in simulators)
{
Expand Down Expand Up @@ -308,25 +290,6 @@ public AppRunner(IMLaunchProcessManager processManager,
log.StopCapture();
log.Dispose();
}

// Remove empty files
if (stdoutLogPath != null)
{
var fileInfo = new FileInfo(stdoutLogPath);
if (fileInfo.Exists && fileInfo.Length == 0)
{
fileInfo.Delete();
}
}

if (stderrLogPath != null)
{
var fileInfo = new FileInfo(stderrLogPath);
if (fileInfo.Exists && fileInfo.Length == 0)
{
fileInfo.Delete();
}
}
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public async Task RunOnSimulatorSuccessfullyTest(bool useTunnel, bool useXml)
$"-argument=-app-arg:-hostname:127.0.0.1 -setenv=NUNIT_HOSTNAME=127.0.0.1 -argument=-app-arg:-transport:Tcp " +
$"-setenv=NUNIT_TRANSPORT=TCP -argument=-app-arg:-hostport:{_listener.Object.Port} " +
$"-setenv=NUNIT_HOSTPORT={_listener.Object.Port} {xmlParam}--launchsim {StringUtils.FormatArguments(s_appPath)} " +
$"--stderr=tty1 --device=:v2:udid={simulator.Object.UDID}";
$"--device=:v2:udid={simulator.Object.UDID}";

_processManager
.Verify(
Expand Down

0 comments on commit 71d0337

Please sign in to comment.