@@ -484,23 +484,6 @@ def run_gcc_torture_tests():
484484 fail (actual , expected )
485485
486486def run_emscripten_tests ():
487- if MOZJS and 0 :
488-
489- print '\n [ checking native wasm support ]\n '
490-
491- command = [EMCC , '-o' , 'a.wasm.js' , '-s' , 'BINARYEN=1' , os .path .join (options .binaryen_test , 'hello_world.c' ), '-s' , 'BINARYEN_METHOD="native-wasm"' , '-s' , 'BINARYEN_SCRIPTS="spidermonkify.py"' ]
492- print ' ' .join (command )
493- subprocess .check_call (command )
494-
495- cmd = [MOZJS , 'a.wasm.js' ]
496- out = run_command (cmd )
497- assert 'hello, world!' in out , out
498-
499- proc = subprocess .Popen ([NODEJS , 'a.wasm.js' ], stdout = subprocess .PIPE , stderr = subprocess .PIPE )
500- out , err = proc .communicate ()
501- assert proc .returncode != 0 , 'should fail on no wasm support'
502- assert 'no native wasm support detected' in err , err
503-
504487 print '\n [ checking wasm.js methods... ]\n '
505488
506489 for method_init in ['interpret-asm2wasm' , 'interpret-s-expr' , 'asmjs' , 'interpret-binary' , 'asmjs,interpret-binary' , 'interpret-binary,asmjs' ]:
@@ -554,58 +537,6 @@ def break_cashew():
554537 assert proc .returncode != 0 , err
555538 assert 'hello, world!' not in out , out
556539
557- print '\n [ checking wasm.js testcases... ]\n '
558-
559- for c in tests :
560- if c .endswith (('.c' , '.cpp' )):
561- print '..' , c
562- base = c .replace ('.cpp' , '' ).replace ('.c' , '' )
563- post = base + '.post.js'
564- try :
565- post = open (os .path .join (options .binaryen_test , post )).read ()
566- except :
567- post = None
568- expected = open (os .path .join (options .binaryen_test , base + '.txt' )).read ()
569- emcc = os .path .join (options .binaryen_test , base + '.emcc' )
570- extra = []
571- if os .path .exists (emcc ):
572- extra = json .loads (open (emcc ).read ())
573- if os .path .exists ('a.normal.js' ): os .unlink ('a.normal.js' )
574- for opts in [[], ['-O1' ], ['-O2' ], ['-O3' ], ['-Oz' ]]:
575- for method in ['interpret-asm2wasm' , 'interpret-s-expr' , 'interpret-binary' ]:
576- command = [EMCC , '-o' , 'a.wasm.js' , '-s' , 'BINARYEN=1' , os .path .join (options .binaryen_test , c )] + opts + extra
577- command += ['-s' , 'BINARYEN_METHOD="' + method + '"' ]
578- command += ['-s' , 'BINARYEN_TRAP_MODE="js"' ]
579- print '....' + ' ' .join (command )
580- subprocess .check_call (command , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
581- if post :
582- open ('a.wasm.js' , 'a' ).write (post )
583- else :
584- print ' (no post)'
585- for which in ['wasm' ]:
586- print '......' , which
587- try :
588- args = json .loads (open (os .path .join (options .binaryen_test , base + '.args' )).read ())
589- except :
590- args = []
591- print ' (no args)'
592-
593- def execute ():
594- if NODEJS :
595- cmd = [NODEJS , 'a.' + which + '.js' ] + args
596- out = run_command (cmd )
597- if out .strip () != expected .strip ():
598- fail (out , expected )
599-
600- execute ()
601-
602- if method in ['interpret-s-expr' ]:
603- # binary and back
604- shutil .copyfile ('a.wasm.wast' , 'a.wasm.original.wast' )
605- recreated = binary_format_check ('a.wasm.wast' , verify_final_result = False )
606- shutil .copyfile (recreated , 'a.wasm.wast' )
607- execute ()
608-
609540
610541# Run all the tests
611542run_help_tests ()
0 commit comments