#!/usr/bin/env bash rev_file=.unit.rev if [ "$1" = "" ]; then echo "For bisect.pl testing." echo echo "Usage:" echo "./bisect.pl -c "unit_test -c" \\" echo " -b "unit_test -b BAD_COMPILATION_REV" \\" echo " -t "unit_test -t BAD_TEST_REV" \\" echo " start_rev stop_rev" echo echo "So that you can make sure that BAD_COMPILATION_REV" echo "does't break the bisect looking for BAD_TEST_REV." rm -f $rev_file exit 0 fi # Replaces checkout.sh REV # Dummy print revision to temp file if [ "$1" = "-c" ]; then echo $2 > $rev_file exit 0 fi # From here on, we assume the temp file exists if [ ! -f $rev_file ]; then echo "Use unit_checkout.sh REV first" exit 1 fi REV=`cat $rev_file` echo "Testing revision $REV..." # Replaces run.sh # Dummy check for temp rev, compares to fake broken arg if [ "$1" = "-b" ]; then if [ "$2" = "$REV" ]; then echo "Bad compilation" exit 1 else echo "Good compilation" exit 0 fi fi # Replaces test.sh # Dummy check for temp rev, compares to fake broken arg if [ "$1" = "-t" ]; then if [ $REV -ge $2 ]; then echo "Bad test" exit 1 else echo "Good test" exit 0 fi fi