diff options
Diffstat (limited to 'test/malloc_common.tcl')
-rw-r--r-- | test/malloc_common.tcl | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/malloc_common.tcl b/test/malloc_common.tcl index b586c88d1..625dd4322 100644 --- a/test/malloc_common.tcl +++ b/test/malloc_common.tcl @@ -129,6 +129,8 @@ proc do_faultsim_test {name args} { set DEFAULT(-test) "" set DEFAULT(-install) "" set DEFAULT(-uninstall) "" + set DEFAULT(-start) 1 + set DEFAULT(-end) 0 fix_testname name @@ -146,7 +148,8 @@ proc do_faultsim_test {name args} { } set testspec [list -prep $O(-prep) -body $O(-body) \ - -test $O(-test) -install $O(-install) -uninstall $O(-uninstall) + -test $O(-test) -install $O(-install) -uninstall $O(-uninstall) \ + -start $O(-start) -end $O(-end) ] foreach f [lsort -unique $faultlist] { eval do_one_faultsim_test "$name-$f" $FAULTSIM($f) $testspec @@ -318,6 +321,8 @@ proc faultsim_test_result_int {args} { # # -test Script to execute after -body. # +# -start Index of first fault to inject (default 1) +# proc do_one_faultsim_test {testname args} { set DEFAULT(-injectstart) "expr" @@ -330,6 +335,8 @@ proc do_one_faultsim_test {testname args} { set DEFAULT(-test) "" set DEFAULT(-install) "" set DEFAULT(-uninstall) "" + set DEFAULT(-start) 1 + set DEFAULT(-end) 0 array set O [array get DEFAULT] array set O $args @@ -346,7 +353,10 @@ proc do_one_faultsim_test {testname args} { eval $O(-install) set stop 0 - for {set iFail 1} {!$stop} {incr iFail} { + for {set iFail $O(-start)} \ + {!$stop && ($O(-end)==0 || $iFail<=$O(-end))} \ + {incr iFail} \ + { # Evaluate the -prep script. # |