blob: 0fe2ccee26e5641fad3cbcdcef58d6d3e0f87939 [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;
Jens Geyer56700e42020-02-22 16:51:51 +010020using System.Linq;
Jens Geyeraa0c8b32019-01-28 23:27:45 +010021using ThriftTest;
22
23namespace Client
24{
25 public class Program
26 {
27 public static int Main(string[] args)
28 {
29 try
30 {
31 Console.SetBufferSize(Console.BufferWidth, 4096);
32 }
33 catch (Exception)
34 {
35 Console.WriteLine("Failed to grow scroll-back buffer");
36 }
37
Jens Geyerb541c6f2019-11-23 18:50:22 +010038 // run whatever mode is choosen, default to test impl
Jens Geyer56700e42020-02-22 16:51:51 +010039 var argslist = new List<string>(args);
40 switch (argslist.FirstOrDefault())
Jens Geyeraa0c8b32019-01-28 23:27:45 +010041 {
Jens Geyer56700e42020-02-22 16:51:51 +010042 case "client": // crosstest wants to pass this, so just emit a hint and ignore
43 Console.WriteLine("Hint: The 'client' argument is no longer required.");
44 argslist.RemoveAt(0);
45 return TestClient.Execute(argslist);
Jens Geyerffb97e12019-12-06 23:43:08 +010046 case "--performance":
Jens Geyerec439542019-11-01 19:19:44 +010047 case "--performance-test":
Jens Geyer5a17b132019-05-26 15:53:37 +020048 return Tests.PerformanceTests.Execute();
Jens Geyeraa0c8b32019-01-28 23:27:45 +010049 case "--help":
50 PrintHelp();
51 return 0;
52 default:
Jens Geyer56700e42020-02-22 16:51:51 +010053 return TestClient.Execute(argslist);
Jens Geyeraa0c8b32019-01-28 23:27:45 +010054 }
55 }
56
57 private static void PrintHelp()
58 {
59 Console.WriteLine("Usage:");
Jens Geyerec439542019-11-01 19:19:44 +010060 Console.WriteLine(" Client [options]");
61 Console.WriteLine(" Client --performance-test");
Jens Geyeraa0c8b32019-01-28 23:27:45 +010062 Console.WriteLine(" Client --help");
63 Console.WriteLine("");
64
65 TestClient.PrintOptionsHelp();
66 }
67 }
68}
69
70