blob: 49ed1cc8d44049b736e361d646d1a5b69c8102ff [file] [log] [blame]
Jan Tattermusch02017762016-11-23 15:39:56 +01001#region Copyright notice and license
2
Jan Tattermusch7897ae92017-06-07 22:57:36 +02003// Copyright 2016 gRPC authors.
Jan Tattermusch02017762016-11-23 15:39:56 +01004//
Jan Tattermusch7897ae92017-06-07 22:57:36 +02005// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
Jan Tattermusch02017762016-11-23 15:39:56 +01008//
Jan Tattermusch7897ae92017-06-07 22:57:36 +02009// http://www.apache.org/licenses/LICENSE-2.0
Jan Tattermusch02017762016-11-23 15:39:56 +010010//
Jan Tattermusch7897ae92017-06-07 22:57:36 +020011// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
Jan Tattermusch02017762016-11-23 15:39:56 +010016
17#endregion
18
19using System;
20using System.Reflection;
21using Grpc.Core;
22using Grpc.Core.Logging;
23using NUnit.Common;
24using NUnitLite;
25
26namespace Grpc.Reflection.Tests
27{
28 /// <summary>
29 /// Provides entry point for NUnitLite
30 /// </summary>
31 public class NUnitMain
32 {
33 public static int Main(string[] args)
34 {
35 // Make logger immune to NUnit capturing stdout and stderr to workaround https://github.com/nunit/nunit/issues/1406.
Jan Tattermuschff6c0362017-08-20 17:25:46 +020036 GrpcEnvironment.SetLogger(new ConsoleLogger());
Jan Tattermusch02017762016-11-23 15:39:56 +010037#if NETCOREAPP1_0
38 return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);
39#else
40 return new AutoRun().Execute(args);
41#endif
42 }
43 }
44}