@@ -7235,6 +7235,38 @@ def test_modularize_instantiation_error(self):
7235
7235
self.assertContained('failed to asynchronously prepare wasm', output)
7236
7236
self.assertContained('got error: RuntimeError: Aborted', output)
7237
7237
7238
+ @crossplatform
7239
+ @node_pthreads
7240
+ def test_pthread_print_override_modularize(self):
7241
+ self.set_setting('EXPORT_NAME', 'Test')
7242
+ self.set_setting('PROXY_TO_PTHREAD')
7243
+ self.set_setting('EXIT_RUNTIME')
7244
+ self.set_setting('MODULARIZE')
7245
+ create_file('main.c', '''
7246
+ #include <emscripten/console.h>
7247
+
7248
+ int main() {
7249
+ emscripten_out("hello, world!");
7250
+ return 0;
7251
+ }
7252
+ ''')
7253
+ create_file('main.js', '''
7254
+ const Test = require('./test.js');
7255
+
7256
+ async function main() {
7257
+ await Test({
7258
+ // world -> earth
7259
+ print: (text) => console.log(text.replace('world', 'earth'))
7260
+ });
7261
+ }
7262
+ main();
7263
+ ''')
7264
+
7265
+ self.emcc('main.c', output_filename='test.js')
7266
+ output = self.run_js('main.js')
7267
+ self.assertNotContained('hello, world!', output)
7268
+ self.assertContained('hello, earth!', output)
7269
+
7238
7270
def test_define_modularize(self):
7239
7271
self.run_process([EMCC, test_file('hello_world.c'), '-sMODULARIZE', '-sASSERTIONS=0'])
7240
7272
src = 'var module = 0; ' + read_file('a.out.js')
0 commit comments