Skip to content
Snippets Groups Projects
Commit 2f0519e9 authored by Jan Tattermusch's avatar Jan Tattermusch
Browse files

work around nunit issue #1406

parent d550ad1f
No related branches found
No related tags found
No related merge requests found
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
using System; using System;
using System.Reflection; using System.Reflection;
using Grpc.Core;
using Grpc.Core.Logging;
using NUnit.Common; using NUnit.Common;
using NUnitLite; using NUnitLite;
...@@ -45,6 +47,8 @@ namespace Grpc.Core.Tests ...@@ -45,6 +47,8 @@ namespace Grpc.Core.Tests
{ {
public static int Main(string[] args) 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 #if DOTNET5_4
return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);
#else #else
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
using System; using System;
using System.Reflection; using System.Reflection;
using Grpc.Core;
using Grpc.Core.Logging;
using NUnit.Common; using NUnit.Common;
using NUnitLite; using NUnitLite;
...@@ -45,6 +47,8 @@ namespace Grpc.Examples.Tests ...@@ -45,6 +47,8 @@ namespace Grpc.Examples.Tests
{ {
public static int Main(string[] args) 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 #if DOTNET5_4
return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);
#else #else
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
using System; using System;
using System.Reflection; using System.Reflection;
using Grpc.Core;
using Grpc.Core.Logging;
using NUnit.Common; using NUnit.Common;
using NUnitLite; using NUnitLite;
...@@ -45,6 +47,8 @@ namespace Grpc.HealthCheck.Tests ...@@ -45,6 +47,8 @@ namespace Grpc.HealthCheck.Tests
{ {
public static int Main(string[] args) 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 #if DOTNET5_4
return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);
#else #else
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
using System; using System;
using System.Reflection; using System.Reflection;
using Grpc.Core;
using Grpc.Core.Logging;
using NUnit.Common; using NUnit.Common;
using NUnitLite; using NUnitLite;
...@@ -45,6 +47,8 @@ namespace Grpc.IntegrationTesting ...@@ -45,6 +47,8 @@ namespace Grpc.IntegrationTesting
{ {
public static int Main(string[] args) 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 #if DOTNET5_4
return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);
#else #else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment