diff options
author | Daniel Thompson <daniel.thompson@linaro.org> | 2021-04-21 11:39:45 +0100 |
---|---|---|
committer | Daniel Thompson <daniel.thompson@linaro.org> | 2021-04-21 11:39:45 +0100 |
commit | ed0b928764ba1cf2b4658d689d9595315dcf3815 (patch) | |
tree | efee3f11b6a4eea82410fbe36fe37d8584c3645b | |
parent | 2c17100501bd8394d0cfd5ed417057791a83215f (diff) |
vote: Simple but useful wrapper for unreliable reproductions
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
-rwxr-xr-x | bin/vote | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/vote b/bin/vote new file mode 100755 index 0000000..c708d03 --- /dev/null +++ b/bin/vote @@ -0,0 +1,25 @@ +#!/bin/bash + +# +# Vote +# +# Run an unreliable command multiple times and report the percentage +# success rate. +# + +[ -z $CYCLES ] && CYCLES=25 + +GOOD=0 + +for i in `seq $CYCLES` +do + "$@" + if [ $? -eq 0 ] + then + GOOD=$(($GOOD + 1)) + fi + + echo + echo "Success rate is $GOOD/$i ($(($GOOD * 100 / $i))%)" + echo +done |