Skip to content

Commit

Permalink
Fix failure to print test results
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Feb 20, 2019
1 parent 571827e commit 0de30f3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Tools/Source/RunTests/TestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ private void Print(List<TestResult> testResults)
private void PrintFailedTestResult(TestResult testResult)
{
// Save out the error output for easy artifact inspecting
var outputLogPath = Path.Combine(_options.LogFilesOutputDirectory, $"xUnit Failure: {testResult.DisplayName}.log");
File.WriteAllText(outputLogPath, testResult.StandardOutput ?? "");
var outputLogPath = Path.Combine(_options.LogFilesOutputDirectory, $"xUnitFailure-{testResult.DisplayName}.log");

ConsoleUtil.WriteLine($"Errors {testResult.AssemblyName}");
ConsoleUtil.WriteLine(testResult.ErrorOutput);
Expand All @@ -170,6 +169,8 @@ private void PrintFailedTestResult(TestResult testResult)
ConsoleUtil.WriteLine($"Command: {testResult.CommandLine}");
ConsoleUtil.WriteLine($"xUnit output log: {outputLogPath}");

File.WriteAllText(outputLogPath, testResult.StandardOutput ?? "");

if (!string.IsNullOrEmpty(testResult.ErrorOutput))
{
ConsoleUtil.WriteLine(testResult.ErrorOutput);
Expand Down

0 comments on commit 0de30f3

Please sign in to comment.