2013-08-08 01:54:08 -04:00
|
|
|
#!/bin/sh
|
|
|
|
# usage:
|
|
|
|
# edit $(srcdir)/test.rb
|
|
|
|
# git bisect start `git svn find-rev <rBADREV>` `git svn find-rev <rGOODREV>`
|
|
|
|
# cd <builddir>
|
|
|
|
# make bisect (or bisect-ruby for full ruby)
|
|
|
|
|
|
|
|
if [ "x" = "x$MAKE" ]; then
|
|
|
|
MAKE=make
|
|
|
|
fi
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
miniruby | ruby ) # (miniruby|ruby) <srcdir>
|
2016-10-06 01:46:55 -04:00
|
|
|
srcdir="$2"
|
2013-08-08 01:54:08 -04:00
|
|
|
builddir=`pwd` # assume pwd is builddir
|
2016-10-06 01:46:55 -04:00
|
|
|
path="$builddir/_bisect.sh"
|
2013-08-08 01:54:08 -04:00
|
|
|
echo "path: $path"
|
2016-10-06 01:46:55 -04:00
|
|
|
cp "$0" "$path"
|
|
|
|
cd "$srcdir"
|
|
|
|
set -x
|
|
|
|
exec git bisect run "$path" "run-$1"
|
2013-08-08 01:54:08 -04:00
|
|
|
;;
|
|
|
|
run-miniruby )
|
2018-02-28 22:26:05 -05:00
|
|
|
prep=mini
|
|
|
|
run=run
|
2013-08-08 01:54:08 -04:00
|
|
|
;;
|
|
|
|
run-ruby )
|
2018-02-28 22:26:05 -05:00
|
|
|
prep=program
|
|
|
|
run=runruby
|
2013-08-08 01:54:08 -04:00
|
|
|
;;
|
|
|
|
"" )
|
2018-02-28 22:26:05 -05:00
|
|
|
echo missing command 1>&2
|
|
|
|
exit 1
|
2013-08-08 01:54:08 -04:00
|
|
|
;;
|
|
|
|
* )
|
2016-10-06 08:15:00 -04:00
|
|
|
echo unknown command "'$1'" 1>&2
|
2016-10-06 01:46:55 -04:00
|
|
|
exit 1
|
2013-08-08 01:54:08 -04:00
|
|
|
;;
|
|
|
|
esac
|
2018-02-28 22:26:05 -05:00
|
|
|
|
|
|
|
case "$0" in
|
|
|
|
*/*)
|
|
|
|
# assume a copy of this script is in builddir
|
|
|
|
cd `echo "$0" | sed 's:\(.*\)/.*:\1:'` || exit 125
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
for target in srcs Makefile $prep; do
|
|
|
|
$MAKE $target || exit 125
|
|
|
|
done
|
|
|
|
exec $MAKE $run
|