work around nunit issue #1406

pull/6134/head
Jan Tattermusch 9 years ago
parent d550ad1f7c
commit 2f0519e9be
  1. 4
      src/csharp/Grpc.Core.Tests/NUnitMain.cs
  2. 4
      src/csharp/Grpc.Examples.Tests/NUnitMain.cs
  3. 4
      src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs
  4. 4
      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.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

@ -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

@ -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

@ -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

Loading…
Cancel
Save