Skip to content

Commit 113b1aa

Browse files
authored
Merge branch 'main' into bufix/emsymbolizer_symbolmap
2 parents 826469e + 84cfc10 commit 113b1aa

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

test/test_core.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,6 +2084,11 @@ def test_em_js_address_taken(self):
20842084
def test_runtime_stacksave(self):
20852085
self.do_runf('core/test_runtime_stacksave.c', 'success')
20862086

2087+
# This helper function removes the special 'Warning: Enlarging memory arrays, this is not fast!'
2088+
# warning in WASM2JS modes that can interfere with testing.
2089+
def remove_growth_warning(self, text):
2090+
return re.sub(r"\nWarning: Enlarging memory arrays, this is not fast! \d+,\d+\n", "\n", text)
2091+
20872092
# Tests that -sMINIMAL_RUNTIME builds can utilize -sALLOW_MEMORY_GROWTH option.
20882093
@no_4gb('memory growth issues')
20892094
@no_2gb('memory growth issues')
@@ -2097,7 +2102,9 @@ def test_minimal_runtime_memorygrowth(self):
20972102
self.do_runf(src, 'OOM', assert_returncode=NON_ZERO)
20982103
# Win with it
20992104
self.set_setting('ALLOW_MEMORY_GROWTH')
2100-
self.do_runf(src, '*pre: hello,4.955*\n*hello,4.955*\n*hello,4.955*')
2105+
output = self.do_runf(src)
2106+
output = self.remove_growth_warning(output)
2107+
self.assertContained('*pre: hello,4.955*\n*hello,4.955*\n*hello,4.955*', output)
21012108

21022109
@no_2gb('memory growth issues')
21032110
@no_4gb('memory growth issues')
@@ -2118,7 +2125,9 @@ def test_memorygrowth(self):
21182125

21192126
# Win with it
21202127
self.set_setting('ALLOW_MEMORY_GROWTH')
2121-
self.do_runf(src, '*pre: hello,4.955*\n*hello,4.955*\n*hello,4.955*')
2128+
output = self.do_runf(src)
2129+
output = self.remove_growth_warning(output)
2130+
self.assertContained('*pre: hello,4.955*\n*hello,4.955*\n*hello,4.955*', output)
21222131
win = read_file(self.output_name('test_memorygrowth'))
21232132

21242133
if '-O2' in self.cflags and self.is_wasm2js():
@@ -2133,7 +2142,9 @@ def test_memorygrowth(self):
21332142
# (SAFE_HEAP would instrument the tracing code itself, leading to recursion)
21342143
if not self.get_setting('SAFE_HEAP'):
21352144
self.cflags += ['--tracing']
2136-
self.do_runf(src, '*pre: hello,4.955*\n*hello,4.955*\n*hello,4.955*')
2145+
output = self.do_runf(src)
2146+
output = self.remove_growth_warning(output)
2147+
self.assertContained('*pre: hello,4.955*\n*hello,4.955*\n*hello,4.955*', output)
21372148

21382149
@no_4gb('memory growth issues')
21392150
@no_2gb('memory growth issues')
@@ -2151,7 +2162,9 @@ def test_memorygrowth_2(self):
21512162

21522163
# Win with it
21532164
self.set_setting('ALLOW_MEMORY_GROWTH')
2154-
self.do_runf(src, '*pre: hello,4.955*\n*hello,4.955*\n*hello,4.955*')
2165+
output = self.do_runf(src)
2166+
output = self.remove_growth_warning(output)
2167+
self.assertContained('*pre: hello,4.955*\n*hello,4.955*\n*hello,4.955*', output)
21552168
win = read_file(self.output_name('test_memorygrowth_2'))
21562169

21572170
if '-O2' in self.cflags and self.is_wasm2js():

0 commit comments

Comments
 (0)