Skip to content

Commit

Permalink
Use Trace.WriteLine
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev committed Apr 25, 2017
1 parent cb14194 commit 534d8f3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/runner/nunit.runner.Droid/nunit.runner.Droid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;__DROID__</DefineConstants>
<DefineConstants>TRACE;DEBUG;__DROID__;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\nunit.runner.Droid.XML</DocumentationFile>
Expand All @@ -33,7 +33,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;__DROID__</DefineConstants>
<DefineConstants>TRACE;__DROID__;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\nunit.runner.Droid.XML</DocumentationFile>
Expand Down
3 changes: 2 additions & 1 deletion src/runner/nunit.runner.iOS/nunit.runner.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<DefineConstants>__UNIFIED__;__MOBILE__;__IOS__;DEBUG;TRACE;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
Expand All @@ -29,6 +29,7 @@
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>__UNIFIED__;__MOBILE__;__IOS__;TRACE;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
Expand Down
1 change: 1 addition & 0 deletions src/runner/nunit.runner.uwp/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"Microsoft.NETCore.UniversalWindowsPlatform": "5.3.1",
"NUnit": "3.6.1",
"PCLStorage": "1.0.2",
"System.Diagnostics.TraceSource": "4.3.0",
"Xamarin.Forms": "2.3.4.224"
},
"frameworks": {
Expand Down
12 changes: 2 additions & 10 deletions src/runner/nunit.runner/Helpers/TestPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,7 @@ private static void LogTestRun(ITestResult result)
{
var total = result.FailCount + result.PassCount + result.InconclusiveCount;
var message = $"Tests run: {total} Passed: {result.PassCount} Failed: {result.FailCount} Inconclusive: {result.InconclusiveCount}";
#if WINDOWS_UWP
Debug.WriteLine(message);
#else
Console.WriteLine(message);
#endif
Trace.WriteLine(message);
}

private class CustomTestListener : ITestListener
Expand All @@ -110,11 +106,7 @@ public void TestFinished(ITestResult result)
var className = result.Test.ClassName?.Split('.').LastOrDefault();
var status = result.ResultState.Status.ToString().ToUpper();
var message = $"\t[{status}] {className}.{result.Test.Name}";
#if WINDOWS_UWP
Debug.WriteLine(message);
#else
Console.WriteLine(message);
#endif
Trace.WriteLine(message);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/runner/nunit.runner/Services/XmlFileProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public override async Task Process(ResultSummary result)
}
catch (Exception ex)
{
Debug.WriteLine("Fatal error while trying to write xml result file! " + ex.Message);
Trace.WriteLine("Fatal error while trying to write xml result file! " + ex.Message);
throw;
}

Expand Down

0 comments on commit 534d8f3

Please sign in to comment.