Skip to content

Commit

Permalink
Added indenting to execution log messages to easier see messages that…
Browse files Browse the repository at this point in the history
… belongs together in a test run
  • Loading branch information
OsirisTerje committed Oct 26, 2018
1 parent c39036a commit 1eaef05
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/NUnitTestAdapter/NUnit3TestExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ private void RunAssembly(string assemblyPath, TestFilter filter)
loadedTestCases.Add(testConverter.ConvertTestCase(testNode));


TestLog.Info($"NUnit3TestExecutor converted {loadedTestCases.Count} of {nunitTestCases.Count} NUnit test cases");
TestLog.Info($" NUnit3TestExecutor converted {loadedTestCases.Count} of {nunitTestCases.Count} NUnit test cases");

// If we have a TFS Filter, convert it to an nunit filter
if (TfsFilter != null && !TfsFilter.IsEmpty)
Expand All @@ -265,7 +265,7 @@ private void RunAssembly(string assemblyPath, TestFilter filter)

if (filter == NUnitTestFilterBuilder.NoTestsFound)
{
TestLog.Info("Skipping assembly - no matching test cases found");
TestLog.Info(" Skipping assembly - no matching test cases found");
return;
}

Expand All @@ -278,7 +278,7 @@ private void RunAssembly(string assemblyPath, TestFilter filter)
catch (NullReferenceException)
{
// this happens during the run when CancelRun is called.
TestLog.Debug("Nullref caught");
TestLog.Debug(" Nullref caught");
}
}
}
Expand All @@ -287,27 +287,27 @@ private void RunAssembly(string assemblyPath, TestFilter filter)
{
var msgNode = loadResult.SelectSingleNode("properties/property[@name='_SKIPREASON']");
if (msgNode != null && (new[] { "contains no tests", "Has no TestFixtures" }).Any(msgNode.GetAttribute("value").Contains))
TestLog.Info("NUnit couldn't find any tests in " + assemblyPath);
TestLog.Info(" NUnit couldn't find any tests in " + assemblyPath);
else
TestLog.Info("NUnit failed to load " + assemblyPath);
TestLog.Info(" NUnit failed to load " + assemblyPath);
}

}
catch (BadImageFormatException)
{
// we skip the native c++ binaries that we don't support.
TestLog.Warning("Assembly not supported: " + assemblyPath);
TestLog.Warning(" Assembly not supported: " + assemblyPath);
}
catch (FileNotFoundException ex)
{
// Probably from the GetExportedTypes in NUnit.core, attempting to find an assembly, not a problem if it is not NUnit here
TestLog.Warning("Dependent Assembly " + ex.FileName + " of " + assemblyPath + " not found. Can be ignored if not a NUnit project.");
TestLog.Warning(" Dependent Assembly " + ex.FileName + " of " + assemblyPath + " not found. Can be ignored if not a NUnit project.");
}
catch (Exception ex)
{
if (ex is TargetInvocationException)
ex = ex.InnerException;
TestLog.Warning("Exception thrown executing tests in " + assemblyPath, ex);
TestLog.Warning(" Exception thrown executing tests in " + assemblyPath, ex);
}
finally
{
Expand All @@ -324,7 +324,7 @@ private void RunAssembly(string assemblyPath, TestFilter filter)
// can happen if CLR throws CannotUnloadAppDomainException, for example
// due to a long-lasting operation in a protected region (catch/finally clause).
if (ex is TargetInvocationException) { ex = ex.InnerException; }
TestLog.Warning("Exception thrown unloading tests from " + assemblyPath, ex);
TestLog.Warning(" Exception thrown unloading tests from " + assemblyPath, ex);
}
}
}
Expand Down

0 comments on commit 1eaef05

Please sign in to comment.