@@ -158,7 +158,7 @@ def PythonTcpEchoServerProcess(port):
158158
159159
160160class sockets (BrowserCore ):
161- emcc_args : List [str ] = []
161+ cflags : List [str ] = []
162162
163163 @classmethod
164164 def setUpClass (cls ):
@@ -185,15 +185,15 @@ def test_sockets_echo(self, harness_class, port, args):
185185 self .skipTest ('requires native clang' )
186186
187187 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 )
189189
190190 def test_sockets_echo_pthreads (self ):
191191 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 ])
193193
194194 def test_sdl2_sockets_echo (self ):
195195 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 ])
197197
198198 @parameterized ({
199199 'websockify' : [WebsockifyServerHarness , 49166 , ['-DTEST_DGRAM=0' ]],
@@ -208,12 +208,12 @@ def test_sockets_async_echo(self, harness_class, port, args):
208208
209209 args .append ('-DTEST_ASYNC=1' )
210210 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 )
212212
213213 def test_sockets_async_bad_port (self ):
214214 # Deliberately attempt a connection on a port that will fail to test the error callback and
215215 # 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' ])
217217
218218 @parameterized ({
219219 'websockify' : [WebsockifyServerHarness , 49171 , ['-DTEST_DGRAM=0' ]],
@@ -235,7 +235,7 @@ def test_sockets_echo_bigdata(self, harness_class, port, args):
235235 create_file ('test_sockets_echo_bigdata.c' , src .replace ('#define MESSAGE "pingtothepong"' , '#define MESSAGE "%s"' % message ))
236236
237237 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 )
239239
240240 @no_windows ('This test is Unix-specific.' )
241241 def test_sockets_partial (self ):
@@ -244,7 +244,7 @@ def test_sockets_partial(self):
244244 CompiledServerHarness (test_file ('sockets/test_sockets_partial_server.c' ), [], 49181 ),
245245 ]:
246246 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 ])
248248
249249 @no_windows ('This test is Unix-specific.' )
250250 def test_sockets_select_server_down (self ):
@@ -253,7 +253,7 @@ def test_sockets_select_server_down(self):
253253 CompiledServerHarness (test_file ('sockets/test_sockets_select_server_down_server.c' ), [], 49191 ),
254254 ]:
255255 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 ])
257257
258258 @no_windows ('This test is Unix-specific.' )
259259 def test_sockets_select_server_closes_connection_rw (self ):
@@ -262,7 +262,7 @@ def test_sockets_select_server_closes_connection_rw(self):
262262 CompiledServerHarness (test_file ('sockets/test_sockets_echo_server.c' ), ['-DCLOSE_CLIENT_AFTER_ECHO' ], 49201 ),
263263 ]:
264264 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 ])
266266
267267 @no_windows ('This test uses Unix-specific build architecture.' )
268268 def test_enet (self ):
@@ -274,7 +274,7 @@ def test_enet(self):
274274 enet = [self .in_dir ('enet' , '.libs' , 'libenet.a' ), '-I' + self .in_dir ('enet' , 'include' )]
275275
276276 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 ])
278278
279279 @crossplatform
280280 @parameterized ({
@@ -290,10 +290,10 @@ def test_nodejs_sockets_echo(self, harness_class, port, args):
290290 # Basic test of node client against both a Websockified and compiled echo server.
291291 with harness_class (test_file ('sockets/test_sockets_echo_server.c' ), args , port ) as harness :
292292 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 )
294294
295295 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 )
297297
298298 @requires_native_clang
299299 def test_nodejs_sockets_echo_subprotocol (self ):
@@ -336,7 +336,7 @@ def test_nodejs_sockets_echo_subprotocol_runtime(self):
336336 })
337337 def test_websocket_send (self , args ):
338338 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 )
340340
341341 # Test that native POSIX sockets API can be used by proxying calls to an intermediate WebSockets
342342 # -> POSIX sockets bridge server
@@ -352,17 +352,17 @@ def test_posix_proxy_sockets(self):
352352 with BackgroundServerProcess ([proxy_server , '8080' ]):
353353 with PythonTcpEchoServerProcess ('7777' ):
354354 # 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' ])
356356
357357 # Test that calling send() right after a socket connect() works.
358358 def test_sockets_send_while_connecting (self ):
359359 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' )
361361
362362
363363class sockets64 (sockets ):
364364 def setUp (self ):
365365 super ().setUp ()
366366 self .set_setting ('MEMORY64' )
367- self .emcc_args .append ('-Wno-experimental' )
367+ self .cflags .append ('-Wno-experimental' )
368368 self .require_wasm64 ()
0 commit comments