Jake Farrell | 29defeb | 2011-11-10 21:11:46 +0000 | [diff] [blame] | 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 |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 26 | SysUtils, |
| 27 | TestClient in 'TestClient.pas', |
Roger Meier | 3bef8c2 | 2012-10-06 06:58:00 +0000 | [diff] [blame] | 28 | 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', |
| 34 | Thrift.Collections in '..\src\Thrift.Collections.pas', |
| 35 | Thrift.Server in '..\src\Thrift.Server.pas', |
| 36 | Thrift.Stream in '..\src\Thrift.Stream.pas', |
| 37 | Thrift.Console in '..\src\Thrift.Console.pas', |
Jens Geyer | 6bbbf19 | 2014-09-07 01:45:56 +0200 | [diff] [blame] | 38 | Thrift.TypeRegistry in '..\src\Thrift.TypeRegistry.pas', |
Roger Meier | 3bef8c2 | 2012-10-06 06:58:00 +0000 | [diff] [blame] | 39 | Thrift.Utils in '..\src\Thrift.Utils.pas'; |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 40 | |
Jake Farrell | 29defeb | 2011-11-10 21:11:46 +0000 | [diff] [blame] | 41 | var |
| 42 | nParamCount : Integer; |
| 43 | args : array of string; |
| 44 | i : Integer; |
| 45 | arg : string; |
| 46 | s : string; |
| 47 | |
| 48 | begin |
| 49 | try |
| 50 | Writeln( 'Delphi TestClient '+Thrift.Version); |
| 51 | nParamCount := ParamCount; |
| 52 | SetLength( args, nParamCount); |
| 53 | for i := 1 to nParamCount do |
| 54 | begin |
| 55 | arg := ParamStr( i ); |
| 56 | args[i-1] := arg; |
| 57 | end; |
Jens Geyer | f8a1b7a | 2014-09-24 00:26:46 +0200 | [diff] [blame^] | 58 | ExitCode := TTestClient.Execute( args); |
Jake Farrell | 29defeb | 2011-11-10 21:11:46 +0000 | [diff] [blame] | 59 | except |
Jens Geyer | f8a1b7a | 2014-09-24 00:26:46 +0200 | [diff] [blame^] | 60 | on E: EAbort do begin |
| 61 | ExitCode := $FF; |
| 62 | end; |
Roger Meier | bb6de7a | 2012-05-04 23:35:45 +0000 | [diff] [blame] | 63 | on E: Exception do begin |
Jake Farrell | 29defeb | 2011-11-10 21:11:46 +0000 | [diff] [blame] | 64 | Writeln(E.ClassName, ': ', E.Message); |
Jens Geyer | f8a1b7a | 2014-09-24 00:26:46 +0200 | [diff] [blame^] | 65 | ExitCode := $FF; |
Roger Meier | bb6de7a | 2012-05-04 23:35:45 +0000 | [diff] [blame] | 66 | end; |
Jake Farrell | 29defeb | 2011-11-10 21:11:46 +0000 | [diff] [blame] | 67 | end; |
| 68 | end. |
| 69 | |