blob: 49cb8cd3b9967a77cae079e37b231ea43505d5ba [file] [log] [blame]
Jan Tattermusch21451b72016-04-08 20:59:34 -07001#region Copyright notice and license
2
Jan Tattermusch7897ae92017-06-07 22:57:36 +02003// Copyright 2016 gRPC authors.
Jan Tattermusch21451b72016-04-08 20:59:34 -07004//
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 Tattermusch21451b72016-04-08 20:59:34 -07008//
Jan Tattermusch7897ae92017-06-07 22:57:36 +02009// http://www.apache.org/licenses/LICENSE-2.0
Jan Tattermusch21451b72016-04-08 20:59:34 -070010//
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 Tattermusch21451b72016-04-08 20:59:34 -070016
17#endregion
18
19using System;
20using System.Reflection;
Jan Tattermusch2f0519e2016-04-11 17:52:43 -070021using Grpc.Core;
22using Grpc.Core.Logging;
Jan Tattermusch21451b72016-04-08 20:59:34 -070023using NUnit.Common;
24using NUnitLite;
25
26namespace Grpc.Core.Tests
27{
28 /// <summary>
29 /// Provides entry point for NUnitLite
30 /// </summary>
31 public class NUnitMain
32 {
Jan Tattermusch31b83162016-04-09 14:44:22 -070033 public static int Main(string[] args)
Jan Tattermusch21451b72016-04-08 20:59:34 -070034 {
Jan Tattermusch2f0519e2016-04-11 17:52:43 -070035 // 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 Tattermusch1c0f30c2016-07-30 03:59:16 +080037#if NETCOREAPP1_0
Jan Tattermusch31b83162016-04-09 14:44:22 -070038 return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);
Jan Tattermusch21451b72016-04-08 20:59:34 -070039#else
Jan Tattermusch31b83162016-04-09 14:44:22 -070040 return new AutoRun().Execute(args);
Jan Tattermusch21451b72016-04-08 20:59:34 -070041#endif
42 }
43 }
44}