4 if [ "x$arg" = "x--help" ]; then
5 echo "Usage: $0 [OPTION]... [ITERATIONS] [TESTGROUP]..."
7 echo "Works the same as test-eglib or test-glib with the following"
8 echo "exception. Run test-eglib --help for details on normal testing"
10 echo "If the first OPTION is --speed-compare, the following is"
11 echo "applicable to this program:"
13 echo " --speed-compare run drivers in -qtni mode and report"
14 echo " speed comparison information"
16 echo "After --speed-compare, the number of iterations "
17 echo "(optional, default is 100000) can be specified, followed "
18 echo "by specific tests to run (or none to run all)"
20 echo "If --speed-compare is not the first argument, all arguments are"
21 echo "passed on directly to each driver"
27 if [ ! -x "./test-glib" -o ! -x "./test-eglib" ]; then
31 if [ "x$1" = "x--speed-compare" ]; then
33 if [ ! -z "$2" ]; then
35 *[0-9]*) ITERATIONS
=$2; break;
39 OPTIONS
="-qnti $ITERATIONS"
42 if [ "x$arg" = "x--speed-compare" ]; then
44 elif [ "$arg" = "$ITERATIONS" ]; then
48 OPTIONS
="$OPTIONS $arg"
51 echo "Running tests with $OPTIONS..."
53 GLIB
=`./test-glib $OPTIONS`
54 EGLIB
=`./test-eglib $OPTIONS`
57 FASTER_NAME
=`echo "$GLIB GLib $EGLIB EGlib" | awk '{ if($1 < $3) print $2; else print $4 }'`
58 FASTER_SPEED
=`echo "$GLIB $EGLIB" | awk '{ if($1 < $2) print $1; else print $2 }'`
59 SLOWER_NAME
=`echo "$GLIB GLib $EGLIB EGlib" | awk '{ if($1 > $3) print $2; else print $4 }'`
60 SLOWER_SPEED
=`echo "$GLIB $EGLIB" | awk '{ if($1 > $2) print $1; else print $2 }'`
62 FASTER_PERCENTAGE
=`echo "$SLOWER_SPEED $FASTER_SPEED" | awk '{ print ($1 / $2) * 100 }'`
64 echo "$FASTER_NAME $FASTER_SPEED"
65 echo "$SLOWER_NAME $SLOWER_SPEED"
66 echo "------------------------------------------------"
67 echo "$FASTER_NAME is $FASTER_PERCENTAGE% faster than $SLOWER_NAME"