blob: 799428169809878c6c9e52b3413e1ad377dd519c [file] [log] [blame]
Jake Farrell27274222011-11-10 20:32:44 +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
20program server;
21
22{$APPTYPE CONSOLE}
23
24uses
25 SysUtils,
26 TestServer in 'TestServer.pas',
Jens Geyer01640402013-09-25 21:12:21 +020027 TestServerEvents in 'TestServerEvents.pas',
Jens Geyer66f95362021-03-29 20:35:41 +020028 Thrift.Test in 'gen-delphi\Thrift.Test.pas',
Roger Meier3bef8c22012-10-06 06:58:00 +000029 Thrift in '..\src\Thrift.pas',
Jens Geyer606f1ef2018-04-09 23:09:41 +020030 Thrift.Exception in '..\src\Thrift.Exception.pas',
Roger Meier3bef8c22012-10-06 06:58:00 +000031 Thrift.Transport in '..\src\Thrift.Transport.pas',
Jens Geyerbea9bbe2016-04-20 00:02:40 +020032 Thrift.Socket in '..\src\Thrift.Socket.pas',
Roger Meier3bef8c22012-10-06 06:58:00 +000033 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 Geyerf0e63312015-03-01 18:47:49 +010036 Thrift.Protocol.Compact in '..\src\Thrift.Protocol.Compact.pas',
Jens Geyere0e32402016-04-20 21:50:48 +020037 Thrift.Protocol.Multiplex in '..\src\Thrift.Protocol.Multiplex.pas',
38 Thrift.Processor.Multiplex in '..\src\Thrift.Processor.Multiplex.pas',
Roger Meier3bef8c22012-10-06 06:58:00 +000039 Thrift.Collections in '..\src\Thrift.Collections.pas',
Jens Geyera019cda2019-11-09 23:24:52 +010040 Thrift.Configuration in '..\src\Thrift.Configuration.pas',
Roger Meier3bef8c22012-10-06 06:58:00 +000041 Thrift.Server in '..\src\Thrift.Server.pas',
Jens Geyer6bbbf192014-09-07 01:45:56 +020042 Thrift.TypeRegistry in '..\src\Thrift.TypeRegistry.pas',
Roger Meier3bef8c22012-10-06 06:58:00 +000043 Thrift.Utils in '..\src\Thrift.Utils.pas',
Jens Geyer02230912019-04-03 01:12:51 +020044 Thrift.WinHTTP in '..\src\Thrift.WinHTTP.pas',
Roger Meier3bef8c22012-10-06 06:58:00 +000045 Thrift.Stream in '..\src\Thrift.Stream.pas';
Jake Farrell27274222011-11-10 20:32:44 +000046
47var
48 nParamCount : Integer;
49 args : array of string;
50 i : Integer;
51 arg : string;
Jake Farrell27274222011-11-10 20:32:44 +000052
53begin
54 try
55 Writeln( 'Delphi TestServer '+Thrift.Version);
56 nParamCount := ParamCount;
57 SetLength( args, nParamCount);
Jens Geyer9f7f11e2016-04-14 21:37:11 +020058 for i := 1 to nParamCount do begin
Jake Farrell27274222011-11-10 20:32:44 +000059 arg := ParamStr( i );
60 args[i-1] := arg;
61 end;
Jens Geyer9f7f11e2016-04-14 21:37:11 +020062
Jake Farrell27274222011-11-10 20:32:44 +000063 TTestServer.Execute( args );
Jens Geyer9f7f11e2016-04-14 21:37:11 +020064
Jake Farrell27274222011-11-10 20:32:44 +000065 except
Jens Geyerf8a1b7a2014-09-24 00:26:46 +020066 on E: EAbort do begin
67 ExitCode := $FF;
68 end;
69 on E: Exception do begin
Jake Farrell27274222011-11-10 20:32:44 +000070 Writeln(E.ClassName, ': ', E.Message);
Jens Geyerf8a1b7a2014-09-24 00:26:46 +020071 ExitCode := $FF;
72 end;
Jake Farrell27274222011-11-10 20:32:44 +000073 end;
74end.
75