File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -400,6 +400,21 @@ def test_export_es6_allows_export_in_post_js(self):
400
400
src = read_file('a.out.js')
401
401
self.assertContained('export{doNothing};', src)
402
402
403
+ @parameterized({
404
+ '': ([],),
405
+ 'pthreads': (['-pthread'],),
406
+ })
407
+ def test_export_es6(self, args):
408
+ self.run_process([EMCC, test_file('hello_world.c'), '-sEXPORT_ES6',
409
+ '-o', 'hello.mjs'] + args)
410
+ # In ES6 mode we use MODULARIZE, so we must instantiate an instance of the
411
+ # module to run it.
412
+ create_file('runner.mjs', '''
413
+ import Hello from "./hello.mjs";
414
+ Hello();
415
+ ''')
416
+ self.assertContained('hello, world!', self.run_js('runner.mjs'))
417
+
403
418
def test_emcc_out_file(self):
404
419
# Verify that "-ofile" works in addition to "-o" "file"
405
420
self.run_process([EMCC, '-c', '-ofoo.o', test_file('hello_world.c')])
You can’t perform that action at this time.
0 commit comments