@@ -237,6 +237,8 @@ def setUp(self):
237237 def require_wasm2js (self ):
238238 if self .is_wasm64 ():
239239 self .skipTest ('wasm2js is not compatible with MEMORY64' )
240+ if self .is_2gb () or self .is_4gb ():
241+ self .skipTest ('wasm2js does not support over 2gb of memory' )
240242
241243 def require_jspi (self ):
242244 if not is_chrome ():
@@ -1525,7 +1527,9 @@ def test_idbstore_sync(self, asyncify):
15251527
15261528 def test_idbstore_sync_worker (self ):
15271529 secret = str (time .time ())
1528- self .btest ('test_idbstore_sync_worker.c' , expected = '0' , args = ['-lidbstore.js' , f'-DSECRET="{ secret } "' , '-O3' , '-g2' , '--proxy-to-worker' , '-sINITIAL_MEMORY=80MB' , '-sASYNCIFY' ])
1530+ if not self .is_2gb () and not self .is_4gb ():
1531+ self .set_setting ('INITIAL_MEMORY' , '80mb' )
1532+ self .btest ('test_idbstore_sync_worker.c' , expected = '0' , args = ['-lidbstore.js' , f'-DSECRET="{ secret } "' , '-O3' , '-g2' , '--proxy-to-worker' , '-sASYNCIFY' ])
15291533
15301534 def test_force_exit (self ):
15311535 self .btest_exit ('force_exit.c' , assert_returncode = 10 )
@@ -1816,6 +1820,7 @@ def test_glgears_animation(self, filename):
18161820 self .run_browser ('something.html' , '/report_gl_result?true' )
18171821
18181822 @requires_graphics_hardware
1823+ @no_4gb ('assertion fails' )
18191824 def test_fulles2_sdlproc (self ):
18201825 self .btest_exit ('full_es2_sdlproc.c' , assert_returncode = 1 , args = ['-sGL_TESTING' , '-DHAVE_BUILTIN_SINCOS' , '-sFULL_ES2' , '-lGL' , '-lSDL' , '-lglut' , '-sGL_ENABLE_GET_PROC_ADDRESS' ])
18211826
@@ -1826,6 +1831,7 @@ def test_glgears_deriv(self):
18261831 assert 'gl-matrix' not in read_file ('test.html' ), 'Should not include glMatrix when not needed'
18271832
18281833 @requires_graphics_hardware
1834+ @no_4gb ('fails to render' )
18291835 def test_glbook (self ):
18301836 self .emcc_args .append ('-Wno-int-conversion' )
18311837 self .emcc_args .append ('-Wno-pointer-sign' )
@@ -1859,6 +1865,7 @@ def book_path(path):
18591865 args = args )
18601866
18611867 @requires_graphics_hardware
1868+ @no_4gb ('fails to render' )
18621869 @parameterized ({
18631870 'normal' : (['-sFULL_ES2' ],),
18641871 # Enabling FULL_ES3 also enables ES2 automatically
@@ -2017,6 +2024,7 @@ def test_gl_glteximage(self):
20172024 })
20182025 @requires_graphics_hardware
20192026 @requires_threads
2027+ @no_4gb ('assertion failure' )
20202028 def test_gl_textures (self , args ):
20212029 self .btest_exit ('gl_textures.cpp' , args = ['-lGL' , '-g' , '-sSTACK_SIZE=1MB' ] + args )
20222030
@@ -2047,14 +2055,18 @@ def test_gl_renderers(self):
20472055 self .btest ('gl_renderers.c' , reference = 'gl_renderers.png' , args = ['-sGL_UNSAFE_OPTS=0' , '-sLEGACY_GL_EMULATION' , '-lGL' , '-lSDL' ])
20482056
20492057 @requires_graphics_hardware
2058+ @no_2gb ('render fails' )
2059+ @no_4gb ('render fails' )
20502060 def test_gl_stride (self ):
20512061 self .btest ('gl_stride.c' , reference = 'gl_stride.png' , args = ['-sGL_UNSAFE_OPTS=0' , '-sLEGACY_GL_EMULATION' , '-lGL' , '-lSDL' ])
20522062
20532063 @requires_graphics_hardware
2064+ @no_4gb ('assertion failure' )
20542065 def test_gl_vertex_buffer_pre (self ):
20552066 self .btest ('gl_vertex_buffer_pre.c' , reference = 'gl_vertex_buffer_pre.png' , args = ['-sGL_UNSAFE_OPTS=0' , '-sLEGACY_GL_EMULATION' , '-lGL' , '-lSDL' ])
20562067
20572068 @requires_graphics_hardware
2069+ @no_4gb ('assertion failure' )
20582070 def test_gl_vertex_buffer (self ):
20592071 self .btest ('gl_vertex_buffer.c' , reference = 'gl_vertex_buffer.png' , args = ['-sGL_UNSAFE_OPTS=0' , '-sLEGACY_GL_EMULATION' , '-lGL' , '-lSDL' ], reference_slack = 1 )
20602072
@@ -2310,6 +2322,7 @@ def test_tex_nonbyte(self):
23102322 self .btest ('tex_nonbyte.c' , reference = 'tex_nonbyte.png' , args = ['-sLEGACY_GL_EMULATION' , '-lGL' , '-lSDL' ])
23112323
23122324 @requires_graphics_hardware
2325+ @no_4gb ('fails to render' )
23132326 def test_float_tex (self ):
23142327 self .btest ('float_tex.cpp' , reference = 'float_tex.png' , args = ['-lGL' , '-lglut' ])
23152328
@@ -5571,6 +5584,7 @@ def test_4gb(self):
55715584
55725585 # Tests that emmalloc supports up to 4GB Wasm heaps.
55735586 @no_firefox ('no 4GB support yet' )
5587+ @no_4gb ('uses MAXIMUM_MEMORY' )
55745588 def test_emmalloc_4gb (self ):
55755589 # For now, keep this in browser as this suite runs serially, which
55765590 # means we don't compete for memory with anything else (and run it
@@ -5581,21 +5595,29 @@ def test_emmalloc_4gb(self):
55815595 # Test that it is possible to malloc() a huge 3GB memory block in 4GB mode using emmalloc.
55825596 # Also test emmalloc-memvalidate and emmalloc-memvalidate-verbose build configurations.
55835597 @no_firefox ('no 4GB support yet' )
5598+ @no_2gb ('not enough space tp run in this mode' )
55845599 @parameterized ({
55855600 '' : (['-sMALLOC=emmalloc' ],),
55865601 'debug' : (['-sMALLOC=emmalloc-debug' ],),
55875602 'memvalidate' : (['-sMALLOC=emmalloc-memvalidate' ],),
55885603 'memvalidate_verbose' : (['-sMALLOC=emmalloc-memvalidate-verbose' ],),
55895604 })
55905605 def test_emmalloc_3gb (self , args ):
5591- self .btest_exit ('alloc_3gb.c' ,
5592- args = ['-sMAXIMUM_MEMORY=4GB' , '-sALLOW_MEMORY_GROWTH=1' ] + args )
5606+ if self .is_4gb ():
5607+ self .set_setting ('MAXIMUM_MEMORY' , '8GB' )
5608+ else :
5609+ self .set_setting ('MAXIMUM_MEMORY' , '4GB' )
5610+ self .btest_exit ('alloc_3gb.c' , args = ['-sALLOW_MEMORY_GROWTH=1' ] + args )
55935611
55945612 # Test that it is possible to malloc() a huge 3GB memory block in 4GB mode using dlmalloc.
55955613 @no_firefox ('no 4GB support yet' )
5614+ @no_2gb ('not enough space tp run in this mode' )
55965615 def test_dlmalloc_3gb (self ):
5597- self .btest_exit ('alloc_3gb.c' ,
5598- args = ['-sMALLOC=dlmalloc' , '-sMAXIMUM_MEMORY=4GB' , '-sALLOW_MEMORY_GROWTH=1' ])
5616+ if self .is_4gb ():
5617+ self .set_setting ('MAXIMUM_MEMORY' , '8GB' )
5618+ else :
5619+ self .set_setting ('MAXIMUM_MEMORY' , '4GB' )
5620+ self .btest_exit ('alloc_3gb.c' , args = ['-sMALLOC=dlmalloc' , '-sALLOW_MEMORY_GROWTH=1' ])
55995621
56005622 @no_wasm64 ()
56015623 @parameterized ({
@@ -5649,7 +5671,9 @@ def test_wasmfs_opfs_errors(self):
56495671
56505672 @no_firefox ('no 4GB support yet' )
56515673 def test_emmalloc_memgrowth (self , * args ):
5652- self .btest ('emmalloc_memgrowth.cpp' , expected = '0' , args = ['-sMALLOC=emmalloc' , '-sALLOW_MEMORY_GROWTH=1' , '-sABORTING_MALLOC=0' , '-sASSERTIONS=2' , '-sMINIMAL_RUNTIME=1' , '-sMAXIMUM_MEMORY=4GB' ])
5674+ if not self .is_4gb ():
5675+ self .set_setting ('MAXIMUM_MEMORY' , '4GB' )
5676+ self .btest_exit ('emmalloc_memgrowth.cpp' , args = ['-sMALLOC=emmalloc' , '-sALLOW_MEMORY_GROWTH=1' , '-sABORTING_MALLOC=0' , '-sASSERTIONS=2' , '-sMINIMAL_RUNTIME=1' ])
56535677
56545678 @no_firefox ('no 4GB support yet' )
56555679 @no_2gb ('uses MAXIMUM_MEMORY' )
@@ -5902,6 +5926,8 @@ def setUp(self):
59025926 self .set_setting ('INITIAL_MEMORY' , '4200mb' )
59035927 self .set_setting ('GLOBAL_BASE' , '4gb' )
59045928 self .emcc_args .append ('-Wno-experimental' )
5929+ # Without this we get a warning about GLOBAL_BASE being ignored when used with SIDE_MODULE
5930+ self .emcc_args .append ('-Wno-unused-command-line-argument' )
59055931 self .require_wasm64 ()
59065932
59075933
@@ -5920,3 +5946,5 @@ def setUp(self):
59205946 super ().setUp ()
59215947 self .set_setting ('INITIAL_MEMORY' , '2200mb' )
59225948 self .set_setting ('GLOBAL_BASE' , '2gb' )
5949+ # Without this we get a warning about GLOBAL_BASE being ignored when used with SIDE_MODULE
5950+ self .emcc_args .append ('-Wno-unused-command-line-argument' )
0 commit comments