@@ -24,7 +24,9 @@ with Ada.Text_IO.Text_Streams;
24
24
25
25
with GNAT.OS_Lib ;
26
26
27
+ with AWS.Default ;
27
28
with AWS.Client ;
29
+ with AWS.Config.Set ;
28
30
with AWS.MIME ;
29
31
with AWS.Resources.Streams.Pipe ;
30
32
with AWS.Response ;
@@ -41,7 +43,8 @@ procedure Pipe_Stream is
41
43
42
44
package ASB renames Ada.Synchronous_Barriers;
43
45
44
- WS : Server.HTTP;
46
+ WS : Server.HTTP;
47
+ Conf : AWS.Config.Object;
45
48
Barrier : ASB.Synchronous_Barrier (8 );
46
49
47
50
Stdout : constant Text_IO.Text_Streams.Stream_Access :=
@@ -69,7 +72,10 @@ procedure Pipe_Stream is
69
72
Strm := new Resources.Streams.Pipe.Stream_Type;
70
73
71
74
Resources.Streams.Pipe.Open
72
- (Resources.Streams.Pipe.Stream_Type (Strm.all ), " ./pipe_stream" , Args,
75
+ (Pipe => Resources.Streams.Pipe.Stream_Type (Strm.all ),
76
+ Command => " ./pipe_stream" ,
77
+ Args => Args,
78
+ Timeout => 60_000 ,
73
79
On_Error => On_Error'Unrestricted_Access);
74
80
75
81
return Response.Stream (MIME.Application_Octet_Stream, Strm);
@@ -112,7 +118,10 @@ procedure Pipe_Stream is
112
118
if I = 25600 then
113
119
Append (Output, " OK" & ASCII.LF);
114
120
else
115
- Append (Output, " NOK on " & Utils.Image (I) & ASCII.LF);
121
+ Append
122
+ (Output, " NOK on " & Utils.Image (I) & ASCII.LF &
123
+ M & ASCII.LF); -- Output the message body to have some
124
+ -- information about the test fails
116
125
end if ;
117
126
end ;
118
127
end Run_Test ;
@@ -150,7 +159,7 @@ procedure Pipe_Stream is
150
159
Output : Unbounded_String;
151
160
Prev : Unbounded_String;
152
161
153
- TA : array (1 .. Barrier.Release_Threshold) of access Tester;
162
+ TA : array (1 .. Barrier.Release_Threshold) of access Tester;
154
163
Cnt : Natural := 0 ;
155
164
156
165
-- ----------------
@@ -167,11 +176,19 @@ procedure Pipe_Stream is
167
176
168
177
begin
169
178
if Command_Line.Argument_Count = 0 then
179
+ Conf := Config.Get_Current;
180
+
181
+ AWS.Config.Set.Server_Name (Conf, " pipe" );
182
+ AWS.Config.Set.Server_Host (Conf, " localhost" );
183
+ AWS.Config.Set.Server_Port (Conf, 0 );
184
+ AWS.Config.Set.Max_Connection (Conf, 10 );
185
+ AWS.Config.Set.Send_Timeout (Conf, 60.0 );
186
+ AWS.Config.Set.Cleaner_Server_Response_Timeout (Conf, 120.0 );
187
+
170
188
Server.Start
171
- (WS, " pipe" ,
172
- CB'Unrestricted_Access,
173
- Host => " localhost" ,
174
- Port => 0 );
189
+ (Web_Server => WS,
190
+ Callback => CB'Unrestricted_Access,
191
+ Config => Conf);
175
192
176
193
for T of TA loop
177
194
T := new Tester;
0 commit comments