@@ -2615,7 +2615,7 @@ def get_random_opts():
26152615 counter += 1
26162616 if given_seed is not None :
26172617 seed = given_seed
2618- given_seed_passed = True
2618+ given_seed_error = 0
26192619 else :
26202620 seed = random .randint (0 , 1 << 64 )
26212621 random .seed (seed )
@@ -2656,10 +2656,16 @@ def get_random_opts():
26562656 traceback .print_tb (tb )
26572657 print ('-----------------------------------------' )
26582658 print ('!' )
2659+ # Default to an error code of 1, but change it for certain errors,
2660+ # so we report them differently (useful for the reducer to keep
2661+ # reducing the exact same error category)
2662+ if given_seed is not None :
2663+ given_seed_error = 1
26592664 for arg in e .args :
26602665 print (arg )
2661- if given_seed is not None :
2662- given_seed_passed = False
2666+ if type (arg ) is str :
2667+ if 'comparison error' in arg :
2668+ given_seed_error = 2
26632669
26642670 # We want to generate a template reducer script only when there is
26652671 # no given wasm file. That we have a given wasm file means we are no
@@ -2704,7 +2710,7 @@ def get_random_opts():
27042710%(wasm_opt)s %(features)s %(temp_wasm)s
27052711echo " " $?
27062712
2707- echo "The following value should be 1 :"
2713+ echo "The following value should be >0 :"
27082714
27092715if [ -z "$BINARYEN_FIRST_WASM" ]; then
27102716 # run the command normally
@@ -2782,7 +2788,7 @@ def get_random_opts():
27822788
27832789The following value should be 0:
27842790 0
2785- The following value should be 1 :
2791+ The following value should be >0 :
27862792 1
27872793
27882794(If it does not, then one possible issue is that the fuzzer fails to write a
@@ -2813,9 +2819,9 @@ def get_random_opts():
28132819 print (' ' , testcase_handler .__class__ .__name__ + ':' , testcase_handler .count_runs ())
28142820
28152821 if given_seed is not None :
2816- if given_seed_passed :
2822+ if not given_seed_error :
28172823 print ('(finished running seed %d without error)' % given_seed )
28182824 sys .exit (0 )
28192825 else :
28202826 print ('(finished running seed %d, see error above)' % given_seed )
2821- sys .exit (1 )
2827+ sys .exit (given_seed_error )
0 commit comments