@@ -2084,6 +2084,11 @@ def test_em_js_address_taken(self):
2084
2084
def test_runtime_stacksave (self ):
2085
2085
self .do_runf ('core/test_runtime_stacksave.c' , 'success' )
2086
2086
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
+
2087
2092
# Tests that -sMINIMAL_RUNTIME builds can utilize -sALLOW_MEMORY_GROWTH option.
2088
2093
@no_4gb ('memory growth issues' )
2089
2094
@no_2gb ('memory growth issues' )
@@ -2097,7 +2102,9 @@ def test_minimal_runtime_memorygrowth(self):
2097
2102
self .do_runf (src , 'OOM' , assert_returncode = NON_ZERO )
2098
2103
# Win with it
2099
2104
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 )
2101
2108
2102
2109
@no_2gb ('memory growth issues' )
2103
2110
@no_4gb ('memory growth issues' )
@@ -2118,7 +2125,9 @@ def test_memorygrowth(self):
2118
2125
2119
2126
# Win with it
2120
2127
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 )
2122
2131
win = read_file (self .output_name ('test_memorygrowth' ))
2123
2132
2124
2133
if '-O2' in self .cflags and self .is_wasm2js ():
@@ -2133,7 +2142,9 @@ def test_memorygrowth(self):
2133
2142
# (SAFE_HEAP would instrument the tracing code itself, leading to recursion)
2134
2143
if not self .get_setting ('SAFE_HEAP' ):
2135
2144
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 )
2137
2148
2138
2149
@no_4gb ('memory growth issues' )
2139
2150
@no_2gb ('memory growth issues' )
@@ -2151,7 +2162,9 @@ def test_memorygrowth_2(self):
2151
2162
2152
2163
# Win with it
2153
2164
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 )
2155
2168
win = read_file (self .output_name ('test_memorygrowth_2' ))
2156
2169
2157
2170
if '-O2' in self .cflags and self .is_wasm2js ():
0 commit comments