]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | (* |
2 | * Licensed to the Apache Software Foundation (ASF) under one | |
3 | * or more contributor license agreements. See the NOTICE file | |
4 | * distributed with this work for additional information | |
5 | * regarding copyright ownership. The ASF licenses this file | |
6 | * to you under the Apache License, Version 2.0 (the | |
7 | * "License"); you may not use this file except in compliance | |
8 | * with the License. You may obtain a copy of the License at | |
9 | * | |
10 | * http://www.apache.org/licenses/LICENSE-2.0 | |
11 | * | |
12 | * Unless required by applicable law or agreed to in writing, | |
13 | * software distributed under the License is distributed on an | |
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
15 | * KIND, either express or implied. See the License for the | |
16 | * specific language governing permissions and limitations | |
17 | * under the License. | |
18 | *) | |
19 | ||
20 | ||
21 | program client; | |
22 | ||
23 | {$APPTYPE CONSOLE} | |
24 | ||
25 | uses | |
26 | SysUtils, | |
27 | DataFactory in 'Performance\DataFactory.pas', | |
28 | PerfTests in 'Performance\PerfTests.pas', | |
29 | TestClient in 'TestClient.pas', | |
30 | Thrift.Test, // in 'gen-delphi\Thrift.Test.pas', | |
31 | Thrift in '..\src\Thrift.pas', | |
32 | Thrift.Transport in '..\src\Thrift.Transport.pas', | |
33 | Thrift.Socket in '..\src\Thrift.Socket.pas', | |
34 | Thrift.Exception in '..\src\Thrift.Exception.pas', | |
35 | Thrift.Transport.Pipes in '..\src\Thrift.Transport.Pipes.pas', | |
36 | Thrift.Transport.WinHTTP in '..\src\Thrift.Transport.WinHTTP.pas', | |
37 | Thrift.Transport.MsxmlHTTP in '..\src\Thrift.Transport.MsxmlHTTP.pas', | |
38 | Thrift.Protocol in '..\src\Thrift.Protocol.pas', | |
39 | Thrift.Protocol.JSON in '..\src\Thrift.Protocol.JSON.pas', | |
40 | Thrift.Protocol.Compact in '..\src\Thrift.Protocol.Compact.pas', | |
41 | Thrift.Protocol.Multiplex in '..\src\Thrift.Protocol.Multiplex.pas', | |
42 | Thrift.Collections in '..\src\Thrift.Collections.pas', | |
43 | Thrift.Server in '..\src\Thrift.Server.pas', | |
44 | Thrift.Stream in '..\src\Thrift.Stream.pas', | |
45 | Thrift.TypeRegistry in '..\src\Thrift.TypeRegistry.pas', | |
46 | Thrift.WinHTTP in '..\src\Thrift.WinHTTP.pas', | |
47 | Thrift.Utils in '..\src\Thrift.Utils.pas'; | |
48 | ||
49 | var | |
50 | nParamCount : Integer; | |
51 | args : array of string; | |
52 | i : Integer; | |
53 | arg : string; | |
54 | ||
55 | begin | |
56 | try | |
57 | Writeln( 'Delphi TestClient '+Thrift.Version); | |
58 | nParamCount := ParamCount; | |
59 | SetLength( args, nParamCount); | |
60 | for i := 1 to nParamCount do begin | |
61 | arg := ParamStr( i ); | |
62 | args[i-1] := arg; | |
63 | end; | |
64 | ||
65 | ExitCode := TTestClient.Execute( args); | |
66 | ||
67 | except | |
68 | on E: EAbort do begin | |
69 | ExitCode := $FF; | |
70 | end; | |
71 | on E: Exception do begin | |
72 | Writeln(E.ClassName, ': ', E.Message); | |
73 | ExitCode := $FF; | |
74 | end; | |
75 | end; | |
76 | end. | |
77 |