blob: bd1d6390a12f3beb6d73ec839c38f346a5c811f0 [file] [log] [blame]
Renato Golin94cc1042016-04-26 11:02:23 +01001#!/usr/bin/env bash
2
3# This script is the main driver of the bisection. Please read the
4# README.txt in this directory for more info.
5
6syntax="Syntax: $0 [-(s)tep N | -(o)pts '-hvsc -t TEST'] <first commit> <last commit>"
7
8step=1
9while getopts "s:o:" opt; do
10 case $opt in
11 s)
12 step=$OPTARG
13 ;;
14 o)
15 run_opts="$run_opts $OPTARG"
16 ;;
17 *)
18 echo -e $syntax
19 exit 1
20 ;;
21 esac
22done
23shift $(($OPTIND-1))
24
25if [[ $1 = '' || $2 = '' ]]; then
26 echo -e $syntax
27 exit 1
28fi
29
30from=$1
31to=$(($2+1))
32cur=$from
33
34while [[ $cur < $to ]]; do
35 echo "Testing $cur..."
36 ./checkout.sh $cur 2>&1 > $cur.log
37 ./run.sh $run_opts 2>&1 >> $cur.log
38 if [[ $? != 0 ]]; then
39 echo "BAD"
40 exit 1
41 else
42 echo "GOOD"
43 fi
44 cur=$(($cur+$step))
45done