Skip to content

Instantly share code, notes, and snippets.

@benibela
Created December 3, 2017 16:14
Show Gist options
  • Save benibela/d77e92ccac7a6042a80665e5ec828b0b to your computer and use it in GitHub Desktop.
Save benibela/d77e92ccac7a6042a80665e5ec828b0b to your computer and use it in GitHub Desktop.
FPC/SVN bisection script
#!/bin/bash
testpath=/tmp/fpctest
records=$testpath/records
testsh=$testpath/testrevision.sh
while true; do
oldestfail=$(grep failed $records | grep -oE '^[0-9]+' | sort -n | head -1)
newestok=$(grep ok $records | grep -oE '^[0-9]+' | sort -n | tail -1)
((x=$oldestfail - $newestok))
if [ $x -lt 10 ]; then break; fi
((x=($oldestfail + $newestok) / 2))
echo
echo
echo =========================testing $x====================
$testsh $x
done
((newestok=$newestok + 1))
((oldestfail=$oldestfail - 1))
for i in $(seq $newestok $oldestfail); do
echo
echo
echo =========================testing $i====================
$testsh $i
done
cat $records
#!/bin/bash
rev=$1
rm -r /tmp/fpctest/lib/
rm /tmp/fpctest/xx
set -e
svn update -r $rev
make clean
make install PP=/usr/lib64/fpc/3.0.0/ppcx64 PREFIX=/tmp/fpctest
/tmp/fpctest/lib/fpc/3.1.1/ppcx64 -Xd -Fd -O2 -Cr -Fu/tmp/fpctest/lib/fpc/3.1.1/units/x86_64-linux/rtl/ /tmp/fpctest/xx.pas
if /tmp/fpctest/xx; then echo $rev: ok $? >> /tmp/fpctest/records ;
else echo $rev: failed $? >> /tmp/fpctest/records ; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment