Files
mono/eglib/test/test-both
T
Aaron Bockover bc434b09d7 2006-08-19 Aaron Bockover <[email protected]>
* src/gstring.c: optimize and generalize reallocation by providing
    a GROW_IF_NECESSARY macro, do not use strcpy/strcat as they are
    very, very slow; GString is now much closer to GLib's implementation
    in terms of performance

    * test/string.c: added speed-specific tests to beat on reallocation code

    * test/test-both: run make if the test drivers don't exist


svn path=/trunk/mono/; revision=64075
2006-08-20 04:24:58 +00:00

75 lines
2.0 KiB
Bash
Executable File

#!/bin/sh
for arg in $@; do
if [ "x$arg" = "x--help" ]; then
echo "Usage: $0 [OPTION]... [ITERATIONS] [TESTGROUP]..."
echo ""
echo "Works the same as test-eglib or test-glib with the following"
echo "exception. Run test-eglib --help for details on normal testing"
echo ""
echo "If the first OPTION is --speed-compare, the following is"
echo "applicable to this program:"
echo ""
echo " --speed-compare run drivers in -qtni mode and report"
echo " speed comparison information"
echo ""
echo "After --speed-compare, the number of iterations "
echo "(optional, default is 100000) can be specified, followed "
echo "by specific tests to run (or none to run all)"
echo ""
echo "If --speed-compare is not the first argument, all arguments are"
echo "passed on directly to each driver"
echo ""
exit 1
fi
done
if [ ! -x "./test-glib" -o ! -x "./test-eglib" ]; then
make
fi
if [ "x$1" = "x--speed-compare" ]; then
ITERATIONS=100000
if [ ! -z "$2" ]; then
case $2 in
*[0-9]*) ITERATIONS=$2; break;
esac
fi
OPTIONS="-qnti $ITERATIONS"
for arg in $@; do
if [ "x$arg" = "x--speed-compare" ]; then
continue;
elif [ "$arg" = "$ITERATIONS" ]; then
continue;
fi
OPTIONS="$OPTIONS $arg"
done
echo "Running tests with $OPTIONS..."
GLIB=`./test-glib $OPTIONS`
EGLIB=`./test-eglib $OPTIONS`
# this blows
FASTER_NAME=`echo "$GLIB GLib $EGLIB EGlib" | awk '{ if($1 < $3) print $2; else print $4 }'`
FASTER_SPEED=`echo "$GLIB $EGLIB" | awk '{ if($1 < $2) print $1; else print $2 }'`
SLOWER_NAME=`echo "$GLIB GLib $EGLIB EGlib" | awk '{ if($1 > $3) print $2; else print $4 }'`
SLOWER_SPEED=`echo "$GLIB $EGLIB" | awk '{ if($1 > $2) print $1; else print $2 }'`
FASTER_PERCENTAGE=`echo "$SLOWER_SPEED $FASTER_SPEED" | awk '{ print ($1 / $2) * 100 }'`
echo "$FASTER_NAME $FASTER_SPEED"
echo "$SLOWER_NAME $SLOWER_SPEED"
echo "------------------------------------------------"
echo "$FASTER_NAME is $FASTER_PERCENTAGE% faster than $SLOWER_NAME"
exit 0;
fi
./test-eglib $@
./test-glib $@