提交 e3bb8dd1 编写于 作者: J Jared Parsons 提交者: Jared Parsons

Clean up diagnotic output

上级 74a77944
......@@ -38,7 +38,6 @@ public async Task<TestResult> RunTestAsync(AssemblyInfo assemblyInfo, Cancellati
catch (Exception ex)
{
var msg = $"Unable to calculate content file for {assemblyInfo.AssemblyPath}";
Console.WriteLine(msg);
Logger.LogError(ex, msg + Environment.NewLine + ex.Message);
contentFile = null;
......
......@@ -121,16 +121,25 @@ private void Print(List<TestResult> testResults)
}
Console.WriteLine("================");
var line = new StringBuilder();
foreach (var testResult in testResults)
{
line.Length = 0;
var color = testResult.Succeeded ? Console.ForegroundColor : ConsoleColor.Red;
var message = $"{testResult.DisplayName,-75} {(testResult.Succeeded ? "PASSED" : "FAILED")} {testResult.Elapsed}{(testResult.IsFromCache ? "*" : "")}";
line.Append($"{testResult.DisplayName,-75}");
line.Append($" {(testResult.Succeeded ? "PASSED" : "FAILED")}");
line.Append($" {testResult.Elapsed}");
line.Append($" {(testResult.IsFromCache ? "*" : "")}");
line.Append($" {(!string.IsNullOrEmpty(testResult.Diagnostics) ? "?" : "")}");
var message = line.ToString();
ConsoleUtil.WriteLine(color, message);
Logger.Log(message);
}
Console.WriteLine("================");
// Print diagnostics out last so they are cleanly visible at the end of the test summary
Console.WriteLine("Extra run diagnostics for logging, did not impact run results");
foreach (var testResult in testResults.Where(x => !string.IsNullOrEmpty(x.Diagnostics)))
{
Console.WriteLine(testResult.Diagnostics);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册