Jan Tattermusch | 21451b7 | 2016-04-08 20:59:34 -0700 | [diff] [blame] | 1 | #region Copyright notice and license |
| 2 | |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 3 | // Copyright 2016 gRPC authors. |
Jan Tattermusch | 21451b7 | 2016-04-08 20:59:34 -0700 | [diff] [blame] | 4 | // |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 5 | // 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 Tattermusch | 21451b7 | 2016-04-08 20:59:34 -0700 | [diff] [blame] | 8 | // |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 9 | // http://www.apache.org/licenses/LICENSE-2.0 |
Jan Tattermusch | 21451b7 | 2016-04-08 20:59:34 -0700 | [diff] [blame] | 10 | // |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 11 | // 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 Tattermusch | 21451b7 | 2016-04-08 20:59:34 -0700 | [diff] [blame] | 16 | |
| 17 | #endregion |
| 18 | |
| 19 | using System; |
| 20 | using System.Reflection; |
Jan Tattermusch | 2f0519e | 2016-04-11 17:52:43 -0700 | [diff] [blame] | 21 | using Grpc.Core; |
| 22 | using Grpc.Core.Logging; |
Jan Tattermusch | 21451b7 | 2016-04-08 20:59:34 -0700 | [diff] [blame] | 23 | using NUnit.Common; |
| 24 | using NUnitLite; |
| 25 | |
| 26 | namespace Grpc.IntegrationTesting |
| 27 | { |
| 28 | /// <summary> |
| 29 | /// Provides entry point for NUnitLite |
| 30 | /// </summary> |
| 31 | public class NUnitMain |
| 32 | { |
Jan Tattermusch | 31b8316 | 2016-04-09 14:44:22 -0700 | [diff] [blame] | 33 | public static int Main(string[] args) |
Jan Tattermusch | 21451b7 | 2016-04-08 20:59:34 -0700 | [diff] [blame] | 34 | { |
Jan Tattermusch | 2f0519e | 2016-04-11 17:52:43 -0700 | [diff] [blame] | 35 | // Make logger immune to NUnit capturing stdout and stderr to workaround https://github.com/nunit/nunit/issues/1406. |
Jan Tattermusch | ff6c036 | 2017-08-20 17:25:46 +0200 | [diff] [blame] | 36 | GrpcEnvironment.SetLogger(new ConsoleLogger()); |
Jan Tattermusch | 1c0f30c | 2016-07-30 03:59:16 +0800 | [diff] [blame] | 37 | #if NETCOREAPP1_0 |
Jan Tattermusch | 31b8316 | 2016-04-09 14:44:22 -0700 | [diff] [blame] | 38 | return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); |
Jan Tattermusch | 21451b7 | 2016-04-08 20:59:34 -0700 | [diff] [blame] | 39 | #else |
Jan Tattermusch | 31b8316 | 2016-04-09 14:44:22 -0700 | [diff] [blame] | 40 | return new AutoRun().Execute(args); |
Jan Tattermusch | 21451b7 | 2016-04-08 20:59:34 -0700 | [diff] [blame] | 41 | #endif |
| 42 | } |
| 43 | } |
| 44 | } |