blob: 47dabd3c903e0f1231b5655cbbaacfff8506fe65 [file] [log] [blame]
Jens Geyeraa0c8b32019-01-28 23:27:45 +01001// Licensed to the Apache Software Foundation(ASF) under one
2// or more contributor license agreements.See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership.The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License. You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied. See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18using System;
19using System.Collections.Generic;
20using ThriftTest;
21
22namespace Client
23{
24 public class Program
25 {
26 public static int Main(string[] args)
27 {
28 try
29 {
30 Console.SetBufferSize(Console.BufferWidth, 4096);
31 }
32 catch (Exception)
33 {
34 Console.WriteLine("Failed to grow scroll-back buffer");
35 }
36
Jens Geyerb541c6f2019-11-23 18:50:22 +010037 // run whatever mode is choosen, default to test impl
38 var firstArg = args.Length > 0 ? args[0] : string.Empty;
39 switch (firstArg)
Jens Geyeraa0c8b32019-01-28 23:27:45 +010040 {
41 case "client":
Jens Geyerec439542019-11-01 19:19:44 +010042 Console.WriteLine("The 'client' argument is no longer required.");
43 PrintHelp();
44 return -1;
45 case "--performance-test":
Jens Geyer5a17b132019-05-26 15:53:37 +020046 return Tests.PerformanceTests.Execute();
Jens Geyeraa0c8b32019-01-28 23:27:45 +010047 case "--help":
48 PrintHelp();
49 return 0;
50 default:
Jens Geyerb541c6f2019-11-23 18:50:22 +010051 return TestClient.Execute(new List<string>(args));
Jens Geyeraa0c8b32019-01-28 23:27:45 +010052 }
53 }
54
55 private static void PrintHelp()
56 {
57 Console.WriteLine("Usage:");
Jens Geyerec439542019-11-01 19:19:44 +010058 Console.WriteLine(" Client [options]");
59 Console.WriteLine(" Client --performance-test");
Jens Geyeraa0c8b32019-01-28 23:27:45 +010060 Console.WriteLine(" Client --help");
61 Console.WriteLine("");
62
63 TestClient.PrintOptionsHelp();
64 }
65 }
66}
67
68