#!/usr/bin/env bash # This script is the main driver of the bisection. Please read the # README.txt in this directory for more info. syntax="Syntax: $0 [-(s)tep N | -(o)pts '-hvsc -t TEST'] " step=1 while getopts "s:o:" opt; do case $opt in s) step=$OPTARG ;; o) run_opts="$run_opts $OPTARG" ;; *) echo -e $syntax exit 1 ;; esac done shift $(($OPTIND-1)) if [[ $1 = '' || $2 = '' ]]; then echo -e $syntax exit 1 fi from=$1 to=$(($2+1)) cur=$from while [[ $cur < $to ]]; do echo "Testing $cur..." ./checkout.sh $cur 2>&1 > $cur.log ./run.sh $run_opts 2>&1 >> $cur.log if [[ $? != 0 ]]; then echo "BAD" exit 1 else echo "GOOD" fi cur=$(($cur+$step)) done