Jake Farrell | 2727422 | 2011-11-10 20:32:44 +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 | program server; |
| 21 | |
| 22 | {$APPTYPE CONSOLE} |
| 23 | |
| 24 | uses |
| 25 | SysUtils, |
| 26 | TestServer in 'TestServer.pas', |
Jens Geyer | 0164040 | 2013-09-25 21:12:21 +0200 | [diff] [blame] | 27 | TestServerEvents in 'TestServerEvents.pas', |
Jens Geyer | 66f9536 | 2021-03-29 20:35:41 +0200 | [diff] [blame] | 28 | Thrift.Test in 'gen-delphi\Thrift.Test.pas', |
Roger Meier | 3bef8c2 | 2012-10-06 06:58:00 +0000 | [diff] [blame] | 29 | Thrift in '..\src\Thrift.pas', |
Jens Geyer | 606f1ef | 2018-04-09 23:09:41 +0200 | [diff] [blame] | 30 | Thrift.Exception in '..\src\Thrift.Exception.pas', |
Roger Meier | 3bef8c2 | 2012-10-06 06:58:00 +0000 | [diff] [blame] | 31 | Thrift.Transport in '..\src\Thrift.Transport.pas', |
Jens Geyer | bea9bbe | 2016-04-20 00:02:40 +0200 | [diff] [blame] | 32 | Thrift.Socket in '..\src\Thrift.Socket.pas', |
Roger Meier | 3bef8c2 | 2012-10-06 06:58:00 +0000 | [diff] [blame] | 33 | Thrift.Transport.Pipes in '..\src\Thrift.Transport.Pipes.pas', |
| 34 | Thrift.Protocol in '..\src\Thrift.Protocol.pas', |
| 35 | Thrift.Protocol.JSON in '..\src\Thrift.Protocol.JSON.pas', |
Jens Geyer | f0e6331 | 2015-03-01 18:47:49 +0100 | [diff] [blame] | 36 | Thrift.Protocol.Compact in '..\src\Thrift.Protocol.Compact.pas', |
Jens Geyer | e0e3240 | 2016-04-20 21:50:48 +0200 | [diff] [blame] | 37 | Thrift.Protocol.Multiplex in '..\src\Thrift.Protocol.Multiplex.pas', |
| 38 | Thrift.Processor.Multiplex in '..\src\Thrift.Processor.Multiplex.pas', |
Roger Meier | 3bef8c2 | 2012-10-06 06:58:00 +0000 | [diff] [blame] | 39 | Thrift.Collections in '..\src\Thrift.Collections.pas', |
Jens Geyer | a019cda | 2019-11-09 23:24:52 +0100 | [diff] [blame] | 40 | Thrift.Configuration in '..\src\Thrift.Configuration.pas', |
Roger Meier | 3bef8c2 | 2012-10-06 06:58:00 +0000 | [diff] [blame] | 41 | Thrift.Server in '..\src\Thrift.Server.pas', |
Jens Geyer | 6bbbf19 | 2014-09-07 01:45:56 +0200 | [diff] [blame] | 42 | Thrift.TypeRegistry in '..\src\Thrift.TypeRegistry.pas', |
Roger Meier | 3bef8c2 | 2012-10-06 06:58:00 +0000 | [diff] [blame] | 43 | Thrift.Utils in '..\src\Thrift.Utils.pas', |
Jens Geyer | 0223091 | 2019-04-03 01:12:51 +0200 | [diff] [blame] | 44 | Thrift.WinHTTP in '..\src\Thrift.WinHTTP.pas', |
Roger Meier | 3bef8c2 | 2012-10-06 06:58:00 +0000 | [diff] [blame] | 45 | Thrift.Stream in '..\src\Thrift.Stream.pas'; |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 46 | |
| 47 | var |
| 48 | nParamCount : Integer; |
| 49 | args : array of string; |
| 50 | i : Integer; |
| 51 | arg : string; |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 52 | |
| 53 | begin |
| 54 | try |
| 55 | Writeln( 'Delphi TestServer '+Thrift.Version); |
| 56 | nParamCount := ParamCount; |
| 57 | SetLength( args, nParamCount); |
Jens Geyer | 9f7f11e | 2016-04-14 21:37:11 +0200 | [diff] [blame] | 58 | for i := 1 to nParamCount do begin |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 59 | arg := ParamStr( i ); |
| 60 | args[i-1] := arg; |
| 61 | end; |
Jens Geyer | 9f7f11e | 2016-04-14 21:37:11 +0200 | [diff] [blame] | 62 | |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 63 | TTestServer.Execute( args ); |
Jens Geyer | 9f7f11e | 2016-04-14 21:37:11 +0200 | [diff] [blame] | 64 | |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 65 | except |
Jens Geyer | f8a1b7a | 2014-09-24 00:26:46 +0200 | [diff] [blame] | 66 | on E: EAbort do begin |
| 67 | ExitCode := $FF; |
| 68 | end; |
| 69 | on E: Exception do begin |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 70 | Writeln(E.ClassName, ': ', E.Message); |
Jens Geyer | f8a1b7a | 2014-09-24 00:26:46 +0200 | [diff] [blame] | 71 | ExitCode := $FF; |
| 72 | end; |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 73 | end; |
| 74 | end. |
| 75 | |