blob: 69e44c24bf7de72ea89fae4b074f8e68225eebd6 [file] [log] [blame]
Jake Farrell29defeb2011-11-10 21:11:46 +00001(*
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
21program client;
22
23{$APPTYPE CONSOLE}
24
25uses
Jake Farrell27274222011-11-10 20:32:44 +000026 SysUtils,
27 TestClient in 'TestClient.pas',
Roger Meier3bef8c22012-10-06 06:58:00 +000028 Thrift.Test, // in 'gen-delphi\Thrift.Test.pas',
29 Thrift in '..\src\Thrift.pas',
30 Thrift.Transport in '..\src\Thrift.Transport.pas',
31 Thrift.Transport.Pipes in '..\src\Thrift.Transport.Pipes.pas',
32 Thrift.Protocol in '..\src\Thrift.Protocol.pas',
33 Thrift.Protocol.JSON in '..\src\Thrift.Protocol.JSON.pas',
Jens Geyerf0e63312015-03-01 18:47:49 +010034 Thrift.Protocol.Compact in '..\src\Thrift.Protocol.Compact.pas',
Roger Meier3bef8c22012-10-06 06:58:00 +000035 Thrift.Collections in '..\src\Thrift.Collections.pas',
36 Thrift.Server in '..\src\Thrift.Server.pas',
37 Thrift.Stream in '..\src\Thrift.Stream.pas',
38 Thrift.Console in '..\src\Thrift.Console.pas',
Jens Geyer6bbbf192014-09-07 01:45:56 +020039 Thrift.TypeRegistry in '..\src\Thrift.TypeRegistry.pas',
Roger Meier3bef8c22012-10-06 06:58:00 +000040 Thrift.Utils in '..\src\Thrift.Utils.pas';
Jake Farrell27274222011-11-10 20:32:44 +000041
Jake Farrell29defeb2011-11-10 21:11:46 +000042var
43 nParamCount : Integer;
44 args : array of string;
45 i : Integer;
46 arg : string;
47 s : string;
48
49begin
50 try
51 Writeln( 'Delphi TestClient '+Thrift.Version);
52 nParamCount := ParamCount;
53 SetLength( args, nParamCount);
54 for i := 1 to nParamCount do
55 begin
56 arg := ParamStr( i );
57 args[i-1] := arg;
58 end;
Jens Geyerf8a1b7a2014-09-24 00:26:46 +020059 ExitCode := TTestClient.Execute( args);
Jake Farrell29defeb2011-11-10 21:11:46 +000060 except
Jens Geyerf8a1b7a2014-09-24 00:26:46 +020061 on E: EAbort do begin
62 ExitCode := $FF;
63 end;
Roger Meierbb6de7a2012-05-04 23:35:45 +000064 on E: Exception do begin
Jake Farrell29defeb2011-11-10 21:11:46 +000065 Writeln(E.ClassName, ': ', E.Message);
Jens Geyerf8a1b7a2014-09-24 00:26:46 +020066 ExitCode := $FF;
Roger Meierbb6de7a2012-05-04 23:35:45 +000067 end;
Jake Farrell29defeb2011-11-10 21:11:46 +000068 end;
69end.
70