Moved shell commands for running matinv to a separate file.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8202 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/exp-drd/Testing.txt b/exp-drd/Testing.txt
index d2d0ded..2664147 100644
--- a/exp-drd/Testing.txt
+++ b/exp-drd/Testing.txt
@@ -4,16 +4,11 @@
 1. Run the regression tests. After having compiled DRD, run the following
    command:
      perl tests/vg_regtest exp-drd
-2. Test the slowdown for matinv for various matrix sizes (must be about 45
-   for i == 1 and about 50 for i == 10):
-     time exp-drd/tests/matinv 200
-     for ((i=1;i<=10;i++))
-     do
-       echo "==== $i ===="
-       time ./vg-in-place --tool=exp-drd exp-drd/tests/matinv 200 -t$i
-     done
+2. Test the slowdown for matinv for various matrix sizes via the script
+   exp-drd/scripts/run-matinv (must be about 27 for i == 1 and about
+   36 for i == 10).
 3. Test whether DRD works with standard KDE applications and whether it does
-   not print any error messages:
+   not print any false positives:
      ./vg-in-place --tool=exp-drd kate
      ./vg-in-place --trace-children=yes --tool=exp-drd knode
      ./vg-in-place --trace-children=yes --tool=exp-drd amarokapp
diff --git a/exp-drd/scripts/run-matinv b/exp-drd/scripts/run-matinv
new file mode 100755
index 0000000..496986b
--- /dev/null
+++ b/exp-drd/scripts/run-matinv
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+########################
+# Function definitions #
+########################
+
+source "$(dirname $0)/measurement-functions"
+
+########################
+# Script body          #
+########################
+
+DRD_SCRIPTS_DIR="$(dirname $0)"
+if [ "${DRD_SCRIPTS_DIR:0:1}" != "/" ]; then
+  DRD_SCRIPTS_DIR="$PWD/$DRD_SCRIPTS_DIR"
+fi
+
+VG="${DRD_SCRIPTS_DIR}/../../vg-in-place"
+MATINV="${DRD_SCRIPTS_DIR}/../../exp-drd/tests/matinv"
+
+
+for n in 200 400
+do
+  tmp="/tmp/test-timing.$$"
+  rm -f "${tmp}"
+
+  measure_runtime ${MATINV} $n | avgstddev > "$tmp"
+  read avg1 stddev1 < "$tmp"
+  echo "Average time: ${avg1} +/- ${stddev1} seconds"
+
+  for ((i=1;i<=10;i++))
+  do
+    print_runtime_ratio ${VG} --tool=exp-drd ${MATINV} $n -t$i
+  done
+done