37
37
from common import requires_wasm_eh, crossplatform, with_both_sjlj, also_with_standalone_wasm
38
38
from common import also_with_minimal_runtime, also_with_wasm_bigint, also_with_wasm64, flaky
39
39
from common import EMTEST_BUILD_VERBOSE, PYTHON, WEBIDL_BINDER
40
+ from common import requires_network
40
41
from tools import shared, building, utils, response_file, cache
41
42
from tools.utils import read_file, write_file, delete_file, read_binary
42
43
import common
@@ -1001,6 +1002,7 @@ def test_cmake_emscripten_system_processor(self):
1001
1002
[EMCMAKE, 'cmake', cmake_dir, '-DEMSCRIPTEN_SYSTEM_PROCESSOR=arm'], stdout=PIPE).stdout
1002
1003
self.assertContained('CMAKE_SYSTEM_PROCESSOR is arm', out)
1003
1004
1005
+ @requires_network
1004
1006
def test_cmake_find_stuff(self):
1005
1007
# Ensure that zlib exists in the sysroot
1006
1008
self.run_process([EMCC, test_file('hello_world.c'), '-sUSE_ZLIB'])
@@ -1021,6 +1023,7 @@ def test_cmake_install(self):
1021
1023
self.assertContained('foo: 42\n', self.run_js('build2/Bar.js'))
1022
1024
self.run_process(['cmake', '--build', 'build2', '--target', 'install'])
1023
1025
1026
+ @requires_network
1024
1027
def test_cmake_find_modules(self):
1025
1028
self.run_process([EMCMAKE, 'cmake', test_file('cmake/find_modules')])
1026
1029
self.run_process(['cmake', '--build', '.'])
@@ -2276,6 +2279,7 @@ def test_sdl_scan_code_from_key(self):
2276
2279
''')
2277
2280
self.do_runf('main.c', '204\n')
2278
2281
2282
+ @requires_network
2279
2283
def test_sdl2_mixer_wav(self):
2280
2284
self.emcc(test_file('browser/test_sdl2_mixer_wav.c'), ['-sUSE_SDL_MIXER=2'], output_filename='a.out.js')
2281
2285
self.emcc(test_file('browser/test_sdl2_mixer_wav.c'), ['--use-port=sdl2_mixer'], output_filename='a.out.js')
@@ -2286,11 +2290,13 @@ def test_sdl2_linkable(self):
2286
2290
self.emcc(test_file('browser/test_sdl2_misc.c'), ['-sLINKABLE', '-sUSE_SDL=2'], output_filename='a.out.js')
2287
2291
self.emcc(test_file('browser/test_sdl2_misc.c'), ['-sLINKABLE', '--use-port=sdl2'], output_filename='a.out.js')
2288
2292
2293
+ @requires_network
2289
2294
def test_sdl2_gfx_linkable(self):
2290
2295
# Same as above but for sdl2_gfx library
2291
2296
self.emcc(test_file('browser/test_sdl2_misc.c'), ['-Wl,-fatal-warnings', '-sLINKABLE', '-sUSE_SDL_GFX=2'], output_filename='a.out.js')
2292
2297
self.emcc(test_file('browser/test_sdl2_misc.c'), ['-Wl,-fatal-warnings', '-sLINKABLE', '--use-port=sdl2_gfx'], output_filename='a.out.js')
2293
2298
2299
+ @requires_network
2294
2300
def test_libpng(self):
2295
2301
shutil.copyfile(test_file('third_party/libpng/pngtest.png'), 'pngtest.png')
2296
2302
self.do_runf('third_party/libpng/pngtest.c', 'libpng passes test',
@@ -2299,11 +2305,13 @@ def test_libpng(self):
2299
2305
emcc_args=['--embed-file', 'pngtest.png', '--use-port=libpng'])
2300
2306
2301
2307
@node_pthreads
2308
+ @requires_network
2302
2309
def test_libpng_with_pthreads(self):
2303
2310
shutil.copyfile(test_file('third_party/libpng/pngtest.png'), 'pngtest.png')
2304
2311
self.do_runf('third_party/libpng/pngtest.c', 'libpng passes test',
2305
2312
emcc_args=['--embed-file', 'pngtest.png', '-sUSE_LIBPNG', '-pthread'])
2306
2313
2314
+ @requires_network
2307
2315
def test_giflib(self):
2308
2316
# giftext.c contains a sprintf warning
2309
2317
self.emcc_args += ['-Wno-fortify-source']
@@ -2322,6 +2330,7 @@ def test_giflib(self):
2322
2330
emcc_args=['--embed-file', 'treescap.gif', '--use-port=giflib'],
2323
2331
args=['treescap.gif'])
2324
2332
2333
+ @requires_network
2325
2334
def test_libjpeg(self):
2326
2335
shutil.copyfile(test_file('screenshot.jpg'), 'screenshot.jpg')
2327
2336
self.do_runf('jpeg_test.c', 'Image is 600 by 450 with 3 components',
@@ -2331,22 +2340,26 @@ def test_libjpeg(self):
2331
2340
emcc_args=['--embed-file', 'screenshot.jpg', '--use-port=libjpeg'],
2332
2341
args=['screenshot.jpg'])
2333
2342
2343
+ @requires_network
2334
2344
def test_bullet(self):
2335
2345
self.do_runf('bullet_hello_world.cpp', 'BULLET RUNNING', emcc_args=['-sUSE_BULLET'])
2336
2346
self.do_runf('bullet_hello_world.cpp', 'BULLET RUNNING', emcc_args=['--use-port=bullet'])
2337
2347
2348
+ @requires_network
2338
2349
def test_vorbis(self):
2339
2350
# This will also test if ogg compiles, because vorbis depends on ogg
2340
2351
self.do_runf('vorbis_test.c', 'ALL OK', emcc_args=['-sUSE_VORBIS'])
2341
2352
self.do_runf('vorbis_test.c', 'ALL OK', emcc_args=['--use-port=vorbis'])
2342
2353
2354
+ @requires_network
2343
2355
def test_bzip2(self):
2344
2356
self.do_runf('bzip2_test.c', 'usage: unzcrash filename',
2345
2357
emcc_args=['-sUSE_BZIP2', '-Wno-pointer-sign'])
2346
2358
self.do_runf('bzip2_test.c', 'usage: unzcrash filename',
2347
2359
emcc_args=['--use-port=bzip2', '-Wno-pointer-sign'])
2348
2360
2349
2361
@with_both_sjlj
2362
+ @requires_network
2350
2363
def test_freetype(self):
2351
2364
# copy the Liberation Sans Bold truetype file located in the
2352
2365
# <emscripten_root>/test/freetype to the compilation folder
@@ -2375,19 +2388,24 @@ def test_freetype(self):
2375
2388
self.do_runf('freetype_test.c', expectedOutput,
2376
2389
emcc_args=['--use-port=freetype', '--embed-file', 'LiberationSansBold.ttf'])
2377
2390
2391
+ @requires_network
2392
+ @requires_network
2378
2393
def test_freetype_with_pthreads(self):
2379
2394
# Verify that freetype supports compilation requiring pthreads
2380
2395
self.emcc(test_file('freetype_test.c'), ['-pthread', '-sUSE_FREETYPE'], output_filename='a.out.js')
2381
2396
2397
+ @requires_network
2382
2398
def test_icu(self):
2383
2399
self.set_setting('USE_ICU')
2384
2400
self.do_runf('other/test_icu.cpp')
2385
2401
2402
+ @requires_network
2386
2403
def test_sdl2_ttf(self):
2387
2404
# This is a compile-only to test to verify that sdl2-ttf (and freetype and harfbuzz) are buildable.
2388
2405
self.emcc(test_file('browser/test_sdl2_ttf.c'), args=['-sUSE_SDL=2', '-sUSE_SDL_TTF=2'], output_filename='a.out.js')
2389
2406
self.emcc(test_file('browser/test_sdl2_ttf.c'), args=['--use-port=sdl2', '--use-port=sdl2_ttf'], output_filename='a.out.js')
2390
2407
2408
+ @requires_network
2391
2409
def test_contrib_ports(self):
2392
2410
# Verify that contrib ports can be used (using the only contrib port available ATM, but can be replaced
2393
2411
# with a different contrib port when there is another one
@@ -2401,6 +2419,7 @@ def test_external_ports_simple(self):
2401
2419
self.do_runf('other/test_external_ports_simple.c', emcc_args=[f'--use-port={simple_port_path}'])
2402
2420
2403
2421
@crossplatform
2422
+ @requires_network
2404
2423
def test_external_ports(self):
2405
2424
if config.FROZEN_CACHE:
2406
2425
self.skipTest("test doesn't work with frozen cache")
0 commit comments