vala-tests r40 - trunk/tests/bugs



Author: malureau
Date: Sat Oct 18 23:37:56 2008
New Revision: 40
URL: http://svn.gnome.org/viewvc/vala-tests?rev=40&view=rev

Log:
Add bug 443514 test, and valgrind flags to tests

Added:
   trunk/tests/bugs/443514.test   (contents, props changed)
   trunk/tests/bugs/443514.vala
Modified:
   trunk/tests/bugs/428368.test
   trunk/tests/bugs/433288.test
   trunk/tests/bugs/433290.test
   trunk/tests/bugs/433296.test
   trunk/tests/bugs/434503.test
   trunk/tests/bugs/434506.test
   trunk/tests/bugs/434507.test
   trunk/tests/bugs/434514.test
   trunk/tests/bugs/434515.test
   trunk/tests/bugs/434929.test
   trunk/tests/bugs/435848.test
   trunk/tests/bugs/435853.test
   trunk/tests/bugs/435854.test
   trunk/tests/bugs/436011.test
   trunk/tests/bugs/436760.test
   trunk/tests/bugs/436761.test
   trunk/tests/bugs/437431.test
   trunk/tests/bugs/437434.test
   trunk/tests/bugs/437435.test
   trunk/tests/bugs/442703.test
   trunk/tests/bugs/556881.test
   trunk/tests/bugs/update.sh

Modified: trunk/tests/bugs/428368.test
==============================================================================
--- trunk/tests/bugs/428368.test	(original)
+++ trunk/tests/bugs/428368.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
   $VALAC  --pkg gtk+-2.0 -o $TESTNAME $SRCDIR/$TESTNAME.vala  $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n  ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "x1" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/433288.test
==============================================================================
--- trunk/tests/bugs/433288.test	(original)
+++ trunk/tests/bugs/433288.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
   $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n  ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "x1" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/433290.test
==============================================================================
--- trunk/tests/bugs/433290.test	(original)
+++ trunk/tests/bugs/433290.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
   $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  -c -C $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n  ]; then
@@ -32,7 +44,11 @@
 ! grep -i my 433290.h || exit 1
 
 if [ "xno" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "xno" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/433296.test
==============================================================================
--- trunk/tests/bugs/433296.test	(original)
+++ trunk/tests/bugs/433296.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
   $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n  ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "x1" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/434503.test
==============================================================================
--- trunk/tests/bugs/434503.test	(original)
+++ trunk/tests/bugs/434503.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
 !  $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n ! ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "xno" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "xno" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/434506.test
==============================================================================
--- trunk/tests/bugs/434506.test	(original)
+++ trunk/tests/bugs/434506.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
   $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n  ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "x1" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/434507.test
==============================================================================
--- trunk/tests/bugs/434507.test	(original)
+++ trunk/tests/bugs/434507.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
   $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n  ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "x1" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/434514.test
==============================================================================
--- trunk/tests/bugs/434514.test	(original)
+++ trunk/tests/bugs/434514.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
 !  $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n ! ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "xno" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "xno" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/434515.test
==============================================================================
--- trunk/tests/bugs/434515.test	(original)
+++ trunk/tests/bugs/434515.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
   $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  -D WITH_TEST $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n  ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "x1" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/434929.test
==============================================================================
--- trunk/tests/bugs/434929.test	(original)
+++ trunk/tests/bugs/434929.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
   $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n  ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "x1" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/435848.test
==============================================================================
--- trunk/tests/bugs/435848.test	(original)
+++ trunk/tests/bugs/435848.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
   $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  -X -Wall $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n  ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "x1" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/435853.test
==============================================================================
--- trunk/tests/bugs/435853.test	(original)
+++ trunk/tests/bugs/435853.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
 !  $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n ! ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "xno" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "xno" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/435854.test
==============================================================================
--- trunk/tests/bugs/435854.test	(original)
+++ trunk/tests/bugs/435854.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
 !  $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  -C $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n ! ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "xno" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "xno" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/436011.test
==============================================================================
--- trunk/tests/bugs/436011.test	(original)
+++ trunk/tests/bugs/436011.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
   $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  -c -X -m64 -X -Wall -X -Werror $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n  ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "xno" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "xno" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/436760.test
==============================================================================
--- trunk/tests/bugs/436760.test	(original)
+++ trunk/tests/bugs/436760.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
   $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  -c -C $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n  ]; then
@@ -32,7 +44,11 @@
 grep -q input_stream_ftp 436760.c || exit 1
 
 if [ "xno" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "xno" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/436761.test
==============================================================================
--- trunk/tests/bugs/436761.test	(original)
+++ trunk/tests/bugs/436761.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
   $VALAC  --pkg libxml-2.0 -o $TESTNAME $SRCDIR/$TESTNAME.vala  $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n  ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "x1" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/437431.test
==============================================================================
--- trunk/tests/bugs/437431.test	(original)
+++ trunk/tests/bugs/437431.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
   $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n  ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "x1" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/437434.test
==============================================================================
--- trunk/tests/bugs/437434.test	(original)
+++ trunk/tests/bugs/437434.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
   $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n  ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "x1" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/437435.test
==============================================================================
--- trunk/tests/bugs/437435.test	(original)
+++ trunk/tests/bugs/437435.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
   $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n  ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "x1" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/442703.test
==============================================================================
--- trunk/tests/bugs/442703.test	(original)
+++ trunk/tests/bugs/442703.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
   $VALAC  --pkg gtk+-2.0 -o $TESTNAME $SRCDIR/$TESTNAME.vala  -c $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n  ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "xno" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "xno" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Added: trunk/tests/bugs/443514.test
==============================================================================
--- (empty file)
+++ trunk/tests/bugs/443514.test	Sat Oct 18 23:37:56 2008
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+set -e
+
+TESTNAME=`basename $0 .test`
+SRCDIR=../tests/bugs
+
+if [ "x$VALAC" = "x" ] ; then
+  VALAC=valac
+  SRCDIR=`dirname $0`
+fi
+
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND="valgrind"
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
+while true ; do
+    case "$1" in
+	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
+	--) shift ; break ;;
+	*) break ;;
+    esac
+done
+
+  $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  $VALAFLAGS
+
+if [ "$?" != "0" ] && [ -n  ]; then
+  echo ""
+  echo "*** WARNING: This vala test was expecting to fail ***"
+  echo ""
+  echo "Visit bug: http://bugzilla.gnome.org/show_bug.cgi?id=443514";
+  exit 1
+fi
+
+true || exit 1
+
+if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
+else
+  echo ""
+  [ "x1" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"
+  [ "x1" = "xno" ] && rm -rf 443514.o
+fi
+

Added: trunk/tests/bugs/443514.vala
==============================================================================
--- (empty file)
+++ trunk/tests/bugs/443514.vala	Sat Oct 18 23:37:56 2008
@@ -0,0 +1,12 @@
+using GLib;
+
+class Test {
+	static void main () {
+		var l = new SList<string> ();
+		var ll = new SList< SList<string> > ();
+		l.append ("1");
+		l.append ("2");
+		l.append ("3");
+		ll.append(l.copy ());
+	}
+}
\ No newline at end of file

Modified: trunk/tests/bugs/556881.test
==============================================================================
--- trunk/tests/bugs/556881.test	(original)
+++ trunk/tests/bugs/556881.test	Sat Oct 18 23:37:56 2008
@@ -2,6 +2,7 @@
 
 set -e
 
+TESTNAME=`basename $0 .test`
 SRCDIR=../tests/bugs
 
 if [ "x$VALAC" = "x" ] ; then
@@ -9,16 +10,27 @@
   SRCDIR=`dirname $0`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND=""
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=`basename $0 .test`
-
 !  $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  -C $VALAFLAGS
 
 if [ "$?" != "0" ] && [ -n ! ]; then
@@ -32,7 +44,11 @@
 true || exit 1
 
 if [ "xno" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./$TESTNAME  $@
+  if [ -z $VALGRIND ] ; then
+    sh -c " ./$TESTNAME  $@"
+  else
+    sh -c "$VALGRINDENV  $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
+  fi
 else
   echo ""
   [ "xno" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"

Modified: trunk/tests/bugs/update.sh
==============================================================================
--- trunk/tests/bugs/update.sh	(original)
+++ trunk/tests/bugs/update.sh	Sat Oct 18 23:37:56 2008
@@ -83,6 +83,7 @@
   [ $nr = $test ] && RUN=no BANG="!"
 done
 
+VALGRIND=
 TESTEXPECT=true
 [ "$test" = "433290" ] && TESTEXPECT="! grep -i my 433290.h" VALAFLAGS="$VALAFLAGS -C"
 [ "$test" = "434515" ] && VALAFLAGS="$VALAFLAGS -D WITH_TEST"
@@ -91,6 +92,7 @@
 [ "$test" = "436011" ] && VALAFLAGS="$VALAFLAGS -X -m64 -X -Wall -X -Werror"
 [ "$test" = "436760" ] && TESTEXPECT="grep -q input_stream_ftp 436760.c" VALAFLAGS="$VALAFLAGS -C"
 [ "$test" = "556881" ] && VALAFLAGS="$VALAFLAGS -C"
+[ "$test" = "443514" ] && VALGRIND="valgrind"
 
 BUGZILLA="http://bugzilla.gnome.org/show_bug.cgi?id=$test";
 
@@ -99,6 +101,7 @@
 
 set -e
 
+TESTNAME=\`basename \$0 .test\`
 SRCDIR=../tests/bugs
 
 if [ "x\$VALAC" = "x" ] ; then
@@ -106,16 +109,27 @@
   SRCDIR=\`dirname \$0\`
 fi
 
+TESTENV="G_DEBUG=fatal_warnings"
+
+VALGRIND="$VALGRIND"
+VALGRINDENV="G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1"
+VALGRINDFLAGS="--tool=memcheck --leak-check=full --error-exitcode=1 -q" ;
+
 while true ; do
     case "\$1" in
 	--interact) INTERACT=1 ; shift ;;
+        --memcheck)
+           VALGRIND="valgrind" ;
+           shift ;;
+        --massif)
+           VALGRIND="valgrind" ;
+           VALGRINDFLAGS="--tool=massif --massif-out-file=$TESTNAME.massif" ;
+           shift ;;
 	--) shift ; break ;;
 	*) break ;;
     esac
 done
 
-TESTNAME=\`basename \$0 .test\`
-
 $BANG $VALAC \$VALAC $PACKAGES -o \$TESTNAME \$SRCDIR/\$TESTNAME.vala $VALAFLAGS \$VALAFLAGS
 
 if [ "\$?" != "0" ] && [ -n $BANG ]; then
@@ -129,7 +143,11 @@
 $TESTEXPECT || exit 1
 
 if [ "x$RUN" = "x1" -o "x\$INTERACT" = "x1" ] ; then
-  G_DEBUG=fatal_warnings ./\$TESTNAME $TESTARGS \$@
+  if [ -z \$VALGRIND ] ; then
+    sh -c "$TESTENV ./\$TESTNAME $TESTARGS \$@"
+  else
+    sh -c "\$VALGRINDENV $TESTENV \$VALGRIND \$VALGRINDFLAGS ./\$TESTNAME $TESTARGS \$@"
+  fi
 else
   echo ""
   [ "x$RUN" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]