diff libtests/run-tests.sh @ 498:342822c2d49a

Merge api-inversion branch (-r656:771, but I don't expect to return to that branch) into the trunk. I expect there to be minor performance regressions (e.g. in the SOAP server index cacheing, which I have forcibly removed) and minor unplugged memory leaks (e.g. in audioDB::query(), where I don't free up the datum). I hope that these leaks and performance regressions can be plugged in short order. I also expect that some (but maybe not all) of the issues currently addressed in the memory-leaks branch are superseded or fixed by this merge. There remains much work to be done; go forth and do it.
author mas01cr
date Sat, 10 Jan 2009 16:47:57 +0000
parents cd63493c32a9
children 216b55457009
line wrap: on
line diff
--- a/libtests/run-tests.sh	Sat Jan 10 11:11:27 2009 +0000
+++ b/libtests/run-tests.sh	Sat Jan 10 16:47:57 2009 +0000
@@ -1,15 +1,6 @@
 #! /bin/bash
 
-AUDIODB=../../${EXECUTABLE:-audioDB}
-export AUDIODB
-
-if [ -x ${AUDIODB#../} ]; then 
-  :
-else 
-  echo Cannot execute audioDB: ${AUDIODB#../}
-  exit 1
-fi
-
+# FIXME: work out how to do proper getopt in bash
 if [ "$1" = "--full" ]; then
   pattern="[0-9][0-9][0-9][0-9]*"
 else
@@ -23,8 +14,15 @@
       if [ -f ${file}/short-description ]; then
         awk '{ printf(" (%s)",$0) }' < ${file}/short-description
       fi
+      if [ "$1" = "--valgrind" ]; then
+        echo -n \ under valgrind
+      fi
       echo -n :
-      (cd ${file} && make -f ../libtest.mk >/dev/null 2>&1 && ./test1 > test.out 2> test.err && exit 104)
+      if [ "$1" = "--valgrind" ]; then
+        (cd ${file} && make -f ../libtest.mk >/dev/null 2>&1 && valgrind --leak-check=full --show-reachable=yes --error-exitcode=1 --tool=memcheck ./test1 > test.out 2> test.err)
+      else
+        (cd ${file} && make -f ../libtest.mk >/dev/null 2>&1 && ./test1 > test.out 2> test.err)
+      fi
       EXIT_STATUS=$?
       if [ ${EXIT_STATUS} -eq 14 ]; then
         echo " n/a."