Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
executable file 95 lines (85 sloc) 3.43 KB
if [ -z "$1" ] ; then
echo "Usage: $0 startdate [enddate=now] [revisions-step=10]"
echo "Runs regression tests for all Git revisions up to specified date,"
echo "and produces the FPS measurements for each of the revisions."
echo "Naturally, you'll need to have an Android device connected to USB port,"
echo "and you should disable screen timeout in the Android device settings."
echo "Also, it messes up your current Git branch, so backup all your current changes,"
echo "and you'll have to run command 'git checkout -f sdl_android' after you're done."
if echo "$0" | grep "regression/" ; then
echo Running FPS regression tests
mkdir -p regression
cp -f "$0" regression/
chmod a+x regression/
regression/ "$@"
exit $?
FROM="`git log -n 1 --format='%cD' \"@{$FROM}\" --`"
if [ -z "$TODATE" ] ; then
TO="`git log -n 1 --format='%cD' --`"
if [ -z "$STEP" ] ; then
REVLIMIT="2011-05-31 16:30:08"
if [ `date -d "$REVLIMIT" "+%s"` -gt `date -d "$FROM" "+%s"` ] ; then
echo "----- WARNING ----- ----- WARNING ----- ----- WARNING ----- ----- WARNING -----"
echo "The revisions below date $REVLIMIT do not support skipping the config dialog,"
echo "so they will stuck at the config screen after launching, so no data will be collected."
echo "You will have to launch the tests with those .apk files manually"
echo "----- WARNING ----- ----- WARNING ----- ----- WARNING ----- ----- WARNING -----"
#export OLDBRANCH=`git branch | grep '*' | sed 's/[* ]*//'`
#export CURDIR="`pwd`"
#function restoreGit() {
# echo Restoring Git branch "$OLDBRANCH"
# rm -rf "$CURDIR/project/jni/application/regression"
# git checkout -f "$OLDBRANCH"
# exit 0
#trap restoreGit SIGHUP
echo Revisions from "$FROM" to "$TO" , step "$STEP"
rm -rf regression/regression
cp -r project/jni/application/regression regression/regression
git checkout -f "@{$TO}"
CURRENT="`git log -n 1 --format='%cD' --`"
while [ `date -d "$CURRENT" "+%s"` -gt `date -d "$FROM" "+%s"` ] ; do
CURFMT="`git log -n 1 --format='%ci' -- | sed 's/[+].*//' | sed 's/ /::/'`"
CURFMT=`echo $CURFMT | sed 's/ //'`
echo \"$CURFMT\"
rm -f project/jni/application/src
rm -rf project/jni/application/regression
cp -rf regression/regression project/jni/application/regression
ln -s regression project/jni/application/src
./ -a
echo Patching project/src/
cat project/src/ | \
sed "s/public static boolean DownloadToSdcard = .*;/public static boolean DownloadToSdcard = false;/" > \
mv -f project/src/ project/src/
echo "#define BUILDDATE \"$CURFMT\"" > project/jni/application/regression/regression.h
rm -rf project/obj
cd project
nice -n19 ndk-build V=1 -j4 && ant debug && cp -f bin/DemoActivity-debug.apk ../regression/$CURFMT.apk
cd ..
adb shell pm uninstall net.olofson.ballfield.regression
sleep 2
adb install -r regression/$CURFMT.apk
sleep 5
adb shell am start -n net.olofson.ballfield.regression/.MainActivity
sleep 40
echo >> regression/regression.txt
echo BUILDDATE $CURFMT: "`git log -n 1 --format="%s"`" >> regression/regression.txt
echo >> regression/regression.txt
adb shell logcat -d -t 20 | grep "SDL REGRESSION BUILDDATE $CURFMT" >> regression/regression.txt
adb shell pm uninstall net.olofson.ballfield.regression
git checkout -f "HEAD~$STEP"
CURRENT="`git log -n 1 --format='%cD' --`"
Jump to Line
Something went wrong with that request. Please try again.