aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2016-04-11 17:52:43 -0700
committerGravatar Jan Tattermusch <jtattermusch@google.com>2016-04-11 17:52:43 -0700
commit2f0519e9be3a280483a93d297811882e1e4232b0 (patch)
treeaa9f997a161cf811e2b6dfd111b1ddecf4b832c7 /src/csharp
parentd550ad1f7cd9cbd704a126873b2530e16fc7f3d9 (diff)
work around nunit issue #1406
Diffstat (limited to 'src/csharp')
-rw-r--r--src/csharp/Grpc.Core.Tests/NUnitMain.cs4
-rw-r--r--src/csharp/Grpc.Examples.Tests/NUnitMain.cs4
-rw-r--r--src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs4
-rw-r--r--src/csharp/Grpc.IntegrationTesting/NUnitMain.cs4
4 files changed, 16 insertions, 0 deletions
diff --git a/src/csharp/Grpc.Core.Tests/NUnitMain.cs b/src/csharp/Grpc.Core.Tests/NUnitMain.cs
index 13e5b27f7b..9c1d7bf3c8 100644
--- a/src/csharp/Grpc.Core.Tests/NUnitMain.cs
+++ b/src/csharp/Grpc.Core.Tests/NUnitMain.cs
@@ -33,6 +33,8 @@
using System;
using System.Reflection;
+using Grpc.Core;
+using Grpc.Core.Logging;
using NUnit.Common;
using NUnitLite;
@@ -45,6 +47,8 @@ namespace Grpc.Core.Tests
{
public static int Main(string[] args)
{
+ // Make logger immune to NUnit capturing stdout and stderr to workaround https://github.com/nunit/nunit/issues/1406.
+ GrpcEnvironment.SetLogger(new TextWriterLogger(Console.Error));
#if DOTNET5_4
return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);
#else
diff --git a/src/csharp/Grpc.Examples.Tests/NUnitMain.cs b/src/csharp/Grpc.Examples.Tests/NUnitMain.cs
index e6b76bcf3b..ea87802766 100644
--- a/src/csharp/Grpc.Examples.Tests/NUnitMain.cs
+++ b/src/csharp/Grpc.Examples.Tests/NUnitMain.cs
@@ -33,6 +33,8 @@
using System;
using System.Reflection;
+using Grpc.Core;
+using Grpc.Core.Logging;
using NUnit.Common;
using NUnitLite;
@@ -45,6 +47,8 @@ namespace Grpc.Examples.Tests
{
public static int Main(string[] args)
{
+ // Make logger immune to NUnit capturing stdout and stderr to workaround https://github.com/nunit/nunit/issues/1406.
+ GrpcEnvironment.SetLogger(new TextWriterLogger(Console.Error));
#if DOTNET5_4
return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);
#else
diff --git a/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs b/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs
index 6d77b12fef..0820523f35 100644
--- a/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs
+++ b/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs
@@ -33,6 +33,8 @@
using System;
using System.Reflection;
+using Grpc.Core;
+using Grpc.Core.Logging;
using NUnit.Common;
using NUnitLite;
@@ -45,6 +47,8 @@ namespace Grpc.HealthCheck.Tests
{
public static int Main(string[] args)
{
+ // Make logger immune to NUnit capturing stdout and stderr to workaround https://github.com/nunit/nunit/issues/1406.
+ GrpcEnvironment.SetLogger(new TextWriterLogger(Console.Error));
#if DOTNET5_4
return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);
#else
diff --git a/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs b/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs
index 4db8e158d3..d8902de08f 100644
--- a/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs
+++ b/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs
@@ -33,6 +33,8 @@
using System;
using System.Reflection;
+using Grpc.Core;
+using Grpc.Core.Logging;
using NUnit.Common;
using NUnitLite;
@@ -45,6 +47,8 @@ namespace Grpc.IntegrationTesting
{
public static int Main(string[] args)
{
+ // Make logger immune to NUnit capturing stdout and stderr to workaround https://github.com/nunit/nunit/issues/1406.
+ GrpcEnvironment.SetLogger(new TextWriterLogger(Console.Error));
#if DOTNET5_4
return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);
#else