@@ -158,7 +158,7 @@ def PythonTcpEchoServerProcess(port):
158
158
159
159
160
160
class sockets (BrowserCore ):
161
- emcc_args : List [str ] = []
161
+ cflags : List [str ] = []
162
162
163
163
@classmethod
164
164
def setUpClass (cls ):
@@ -185,15 +185,15 @@ def test_sockets_echo(self, harness_class, port, args):
185
185
self .skipTest ('requires native clang' )
186
186
187
187
with harness_class (test_file ('sockets/test_sockets_echo_server.c' ), args , port ) as harness :
188
- self .btest_exit ('sockets/test_sockets_echo_client.c' , emcc_args = ['-DSOCKK=%d' % harness .listen_port ] + args )
188
+ self .btest_exit ('sockets/test_sockets_echo_client.c' , cflags = ['-DSOCKK=%d' % harness .listen_port ] + args )
189
189
190
190
def test_sockets_echo_pthreads (self ):
191
191
with CompiledServerHarness (test_file ('sockets/test_sockets_echo_server.c' ), [], 49161 ) as harness :
192
- self .btest_exit ('sockets/test_sockets_echo_client.c' , emcc_args = ['-pthread' , '-sPROXY_TO_PTHREAD' , '-DSOCKK=%d' % harness .listen_port ])
192
+ self .btest_exit ('sockets/test_sockets_echo_client.c' , cflags = ['-pthread' , '-sPROXY_TO_PTHREAD' , '-DSOCKK=%d' % harness .listen_port ])
193
193
194
194
def test_sdl2_sockets_echo (self ):
195
195
with CompiledServerHarness ('sockets/sdl2_net_server.c' , ['-sUSE_SDL=2' , '-sUSE_SDL_NET=2' ], 49164 ) as harness :
196
- self .btest_exit ('sockets/sdl2_net_client.c' , emcc_args = ['-sUSE_SDL=2' , '-sUSE_SDL_NET=2' , '-DSOCKK=%d' % harness .listen_port ])
196
+ self .btest_exit ('sockets/sdl2_net_client.c' , cflags = ['-sUSE_SDL=2' , '-sUSE_SDL_NET=2' , '-DSOCKK=%d' % harness .listen_port ])
197
197
198
198
@parameterized ({
199
199
'websockify' : [WebsockifyServerHarness , 49166 , ['-DTEST_DGRAM=0' ]],
@@ -208,12 +208,12 @@ def test_sockets_async_echo(self, harness_class, port, args):
208
208
209
209
args .append ('-DTEST_ASYNC=1' )
210
210
with harness_class (test_file ('sockets/test_sockets_echo_server.c' ), args , port ) as harness :
211
- self .btest_exit ('sockets/test_sockets_echo_client.c' , emcc_args = ['-DSOCKK=%d' % harness .listen_port ] + args )
211
+ self .btest_exit ('sockets/test_sockets_echo_client.c' , cflags = ['-DSOCKK=%d' % harness .listen_port ] + args )
212
212
213
213
def test_sockets_async_bad_port (self ):
214
214
# Deliberately attempt a connection on a port that will fail to test the error callback and
215
215
# getsockopt
216
- self .btest_exit ('sockets/test_sockets_echo_client.c' , emcc_args = ['-DSOCKK=49169' , '-DTEST_ASYNC=1' ])
216
+ self .btest_exit ('sockets/test_sockets_echo_client.c' , cflags = ['-DSOCKK=49169' , '-DTEST_ASYNC=1' ])
217
217
218
218
@parameterized ({
219
219
'websockify' : [WebsockifyServerHarness , 49171 , ['-DTEST_DGRAM=0' ]],
@@ -235,7 +235,7 @@ def test_sockets_echo_bigdata(self, harness_class, port, args):
235
235
create_file ('test_sockets_echo_bigdata.c' , src .replace ('#define MESSAGE "pingtothepong"' , '#define MESSAGE "%s"' % message ))
236
236
237
237
with harness_class (test_file ('sockets/test_sockets_echo_server.c' ), args , port ) as harness :
238
- self .btest_exit ('test_sockets_echo_bigdata.c' , emcc_args = [sockets_include , '-DSOCKK=%d' % harness .listen_port ] + args )
238
+ self .btest_exit ('test_sockets_echo_bigdata.c' , cflags = [sockets_include , '-DSOCKK=%d' % harness .listen_port ] + args )
239
239
240
240
@no_windows ('This test is Unix-specific.' )
241
241
def test_sockets_partial (self ):
@@ -244,7 +244,7 @@ def test_sockets_partial(self):
244
244
CompiledServerHarness (test_file ('sockets/test_sockets_partial_server.c' ), [], 49181 ),
245
245
]:
246
246
with harness :
247
- self .btest_exit ('sockets/test_sockets_partial_client.c' , assert_returncode = 165 , emcc_args = ['-DSOCKK=%d' % harness .listen_port ])
247
+ self .btest_exit ('sockets/test_sockets_partial_client.c' , assert_returncode = 165 , cflags = ['-DSOCKK=%d' % harness .listen_port ])
248
248
249
249
@no_windows ('This test is Unix-specific.' )
250
250
def test_sockets_select_server_down (self ):
@@ -253,7 +253,7 @@ def test_sockets_select_server_down(self):
253
253
CompiledServerHarness (test_file ('sockets/test_sockets_select_server_down_server.c' ), [], 49191 ),
254
254
]:
255
255
with harness :
256
- self .btest_exit ('sockets/test_sockets_select_server_down_client.c' , emcc_args = ['-DSOCKK=%d' % harness .listen_port ])
256
+ self .btest_exit ('sockets/test_sockets_select_server_down_client.c' , cflags = ['-DSOCKK=%d' % harness .listen_port ])
257
257
258
258
@no_windows ('This test is Unix-specific.' )
259
259
def test_sockets_select_server_closes_connection_rw (self ):
@@ -262,7 +262,7 @@ def test_sockets_select_server_closes_connection_rw(self):
262
262
CompiledServerHarness (test_file ('sockets/test_sockets_echo_server.c' ), ['-DCLOSE_CLIENT_AFTER_ECHO' ], 49201 ),
263
263
]:
264
264
with harness :
265
- self .btest_exit ('sockets/test_sockets_select_server_closes_connection_client_rw.c' , emcc_args = ['-DSOCKK=%d' % harness .listen_port ])
265
+ self .btest_exit ('sockets/test_sockets_select_server_closes_connection_client_rw.c' , cflags = ['-DSOCKK=%d' % harness .listen_port ])
266
266
267
267
@no_windows ('This test uses Unix-specific build architecture.' )
268
268
def test_enet (self ):
@@ -274,7 +274,7 @@ def test_enet(self):
274
274
enet = [self .in_dir ('enet' , '.libs' , 'libenet.a' ), '-I' + self .in_dir ('enet' , 'include' )]
275
275
276
276
with CompiledServerHarness (test_file ('sockets/test_enet_server.c' ), enet , 49210 ) as harness :
277
- self .btest_exit ('sockets/test_enet_client.c' , emcc_args = enet + ['-DSOCKK=%d' % harness .listen_port ])
277
+ self .btest_exit ('sockets/test_enet_client.c' , cflags = enet + ['-DSOCKK=%d' % harness .listen_port ])
278
278
279
279
@crossplatform
280
280
@parameterized ({
@@ -290,10 +290,10 @@ def test_nodejs_sockets_echo(self, harness_class, port, args):
290
290
# Basic test of node client against both a Websockified and compiled echo server.
291
291
with harness_class (test_file ('sockets/test_sockets_echo_server.c' ), args , port ) as harness :
292
292
expected = 'do_msg_read: read 14 bytes'
293
- self .do_runf ('sockets/test_sockets_echo_client.c' , expected , emcc_args = ['-DSOCKK=%d' % harness .listen_port ] + args )
293
+ self .do_runf ('sockets/test_sockets_echo_client.c' , expected , cflags = ['-DSOCKK=%d' % harness .listen_port ] + args )
294
294
295
295
def test_nodejs_sockets_connect_failure (self ):
296
- self .do_runf ('sockets/test_sockets_echo_client.c' , 'connect failed: Connection refused' , emcc_args = ['-DSOCKK=666' ], assert_returncode = NON_ZERO )
296
+ self .do_runf ('sockets/test_sockets_echo_client.c' , 'connect failed: Connection refused' , cflags = ['-DSOCKK=666' ], assert_returncode = NON_ZERO )
297
297
298
298
@requires_native_clang
299
299
def test_nodejs_sockets_echo_subprotocol (self ):
@@ -336,7 +336,7 @@ def test_nodejs_sockets_echo_subprotocol_runtime(self):
336
336
})
337
337
def test_websocket_send (self , args ):
338
338
with NodeJsWebSocketEchoServerProcess ():
339
- self .btest_exit ('websocket/test_websocket_send.c' , emcc_args = ['-lwebsocket' , '-sNO_EXIT_RUNTIME' , '-sWEBSOCKET_DEBUG' ] + args )
339
+ self .btest_exit ('websocket/test_websocket_send.c' , cflags = ['-lwebsocket' , '-sNO_EXIT_RUNTIME' , '-sWEBSOCKET_DEBUG' ] + args )
340
340
341
341
# Test that native POSIX sockets API can be used by proxying calls to an intermediate WebSockets
342
342
# -> POSIX sockets bridge server
@@ -352,17 +352,17 @@ def test_posix_proxy_sockets(self):
352
352
with BackgroundServerProcess ([proxy_server , '8080' ]):
353
353
with PythonTcpEchoServerProcess ('7777' ):
354
354
# Build and run the TCP echo client program with Emscripten
355
- self .btest_exit ('websocket/tcp_echo_client.c' , emcc_args = ['-lwebsocket' , '-sPROXY_POSIX_SOCKETS' , '-pthread' , '-sPROXY_TO_PTHREAD' ])
355
+ self .btest_exit ('websocket/tcp_echo_client.c' , cflags = ['-lwebsocket' , '-sPROXY_POSIX_SOCKETS' , '-pthread' , '-sPROXY_TO_PTHREAD' ])
356
356
357
357
# Test that calling send() right after a socket connect() works.
358
358
def test_sockets_send_while_connecting (self ):
359
359
with NodeJsWebSocketEchoServerProcess ():
360
- self .btest ('sockets/test_sockets_send_while_connecting.c' , emcc_args = ['-DSOCKET_DEBUG' ], expected = '0' )
360
+ self .btest ('sockets/test_sockets_send_while_connecting.c' , cflags = ['-DSOCKET_DEBUG' ], expected = '0' )
361
361
362
362
363
363
class sockets64 (sockets ):
364
364
def setUp (self ):
365
365
super ().setUp ()
366
366
self .set_setting ('MEMORY64' )
367
- self .emcc_args .append ('-Wno-experimental' )
367
+ self .cflags .append ('-Wno-experimental' )
368
368
self .require_wasm64 ()
0 commit comments