@@ -77,12 +77,10 @@ def run_wasm_dis_tests():
7777 shared .fail_if_not_identical_to_file (actual , t + '.fromBinary' )
7878
7979 # also verify there are no validation errors
80- def check ():
80+ with shared . with_pass_debug ():
8181 cmd = shared .WASM_OPT + [t , '-all' , '-q' ]
8282 support .run_command (cmd )
8383
84- shared .with_pass_debug (check )
85-
8684
8785def run_crash_tests ():
8886 print ("\n [ checking we don't crash on tricky inputs... ]\n " )
@@ -392,34 +390,30 @@ def run_unittest():
392390 raise Exception ("unittest failed" )
393391
394392
393+ @shared .with_pass_debug ()
395394def run_lit ():
396- def run ():
397- lit_script = os .path .join (shared .options .binaryen_bin , 'binaryen-lit' )
398- lit_tests = os .path .join (shared .options .binaryen_root , 'test' , 'lit' )
399- # lit expects to be run as its own executable
400- cmd = [sys .executable , lit_script , lit_tests , '-vv' ]
401- result = subprocess .run (cmd )
402- if result .returncode != 0 :
403- shared .num_failures += 1
404- if shared .options .abort_on_first_failure and shared .num_failures :
405- raise Exception ("lit test failed" )
406-
407- shared .with_pass_debug (run )
395+ lit_script = os .path .join (shared .options .binaryen_bin , 'binaryen-lit' )
396+ lit_tests = os .path .join (shared .options .binaryen_root , 'test' , 'lit' )
397+ # lit expects to be run as its own executable
398+ cmd = [sys .executable , lit_script , lit_tests , '-vv' ]
399+ result = subprocess .run (cmd )
400+ if result .returncode != 0 :
401+ shared .num_failures += 1
402+ if shared .options .abort_on_first_failure and shared .num_failures :
403+ raise Exception ("lit test failed" )
408404
409405
406+ @shared .with_pass_debug ()
410407def run_gtest ():
411- def run ():
412- gtest = os .path .join (shared .options .binaryen_bin , 'binaryen-unittests' )
413- if not os .path .isfile (gtest ):
414- shared .warn ('gtest binary not found - skipping tests' )
415- else :
416- result = subprocess .run (gtest )
417- if result .returncode != 0 :
418- shared .num_failures += 1
419- if shared .options .abort_on_first_failure and shared .num_failures :
420- raise Exception ("gtest test failed" )
421-
422- shared .with_pass_debug (run )
408+ gtest = os .path .join (shared .options .binaryen_bin , 'binaryen-unittests' )
409+ if not os .path .isfile (gtest ):
410+ shared .warn ('gtest binary not found - skipping tests' )
411+ else :
412+ result = subprocess .run (gtest )
413+ if result .returncode != 0 :
414+ shared .num_failures += 1
415+ if shared .options .abort_on_first_failure and shared .num_failures :
416+ raise Exception ("gtest test failed" )
423417
424418
425419TEST_SUITES = OrderedDict ([
0 commit comments