[vala-tests] tests/bugs: fix it up



commit f5c15efd9bb1a63a3277f78891f4fefa2fe8d064
Author: Marc-André Lureau <marcandre lureau gmail com>
Date:   Sat Mar 20 00:36:12 2010 +0100

    tests/bugs: fix it up

 tests/bugs/428368.test |   59 +----------------
 tests/bugs/433288.test |   58 +----------------
 tests/bugs/433290.test |   64 +++---------------
 tests/bugs/433290.vala |    4 +-
 tests/bugs/433296.test |   58 +----------------
 tests/bugs/434503.test |   59 +----------------
 tests/bugs/434506.test |   58 +----------------
 tests/bugs/434507.test |   58 +----------------
 tests/bugs/434514.test |   59 +----------------
 tests/bugs/434929.test |   58 +----------------
 tests/bugs/435848.test |   59 +----------------
 tests/bugs/435853.test |   59 +----------------
 tests/bugs/435854.test |   60 +----------------
 tests/bugs/436011.test |   59 +----------------
 tests/bugs/436760.test |   62 ++----------------
 tests/bugs/436761.test |   58 +----------------
 tests/bugs/437431.test |   59 +----------------
 tests/bugs/437434.test |   58 +----------------
 tests/bugs/437435.test |   58 +----------------
 tests/bugs/442703.test |   58 +----------------
 tests/bugs/443514.test |   58 +----------------
 tests/bugs/516287.test |   18 +-----
 tests/bugs/536863.test |   17 +-----
 tests/bugs/539969.test |   18 +-----
 tests/bugs/539969.vala |   18 +++---
 tests/bugs/548442.test |   18 +-----
 tests/bugs/556881.test |   59 +----------------
 tests/bugs/571960.test |    4 +
 tests/bugs/576122.test |    4 +
 tests/bugs/test.sh     |  152 --------------------------------------------
 tests/bugs/update.sh   |  165 ------------------------------------------------
 31 files changed, 93 insertions(+), 1563 deletions(-)
---
diff --git a/tests/bugs/428368.test b/tests/bugs/428368.test
index bd81179..670c1e0 100755
--- a/tests/bugs/428368.test
+++ b/tests/bugs/428368.test
@@ -1,57 +1,4 @@
-#!/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=""
-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 -q" ;
-           shift ;;
-	--) shift ; break ;;
-	*) break ;;
-    esac
-done
-
-  $VALAC  --pkg gtk+-2.0 -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=428368";
-  exit 1
-fi
-
-true || exit 1
-
-if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $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 428368.o
-fi
+#!/bin/bash
 
+TESTRUN=yes
+. test-common.sh
diff --git a/tests/bugs/433288.test b/tests/bugs/433288.test
index 97d8eb3..8c65445 100755
--- a/tests/bugs/433288.test
+++ b/tests/bugs/433288.test
@@ -1,57 +1,3 @@
-#!/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=""
-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 -q" ;
-           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=433288";
-  exit 1
-fi
-
-true || exit 1
-
-if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $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 433288.o
-fi
+#!/bin/bash
 
+. test-common.sh
diff --git a/tests/bugs/433290.test b/tests/bugs/433290.test
index 3ee05d9..ff72d70 100755
--- a/tests/bugs/433290.test
+++ b/tests/bugs/433290.test
@@ -1,57 +1,15 @@
-#!/bin/sh
+#!/bin/bash
 
-set -e
+H433290=`mktemp`
 
-TESTNAME=`basename $0 .test`
-SRCDIR=../tests/bugs
+function test_teardown {
+    rm -f $H433290
+}
 
-if [ "x$VALAC" = "x" ] ; then
-  VALAC=valac
-  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=$TESTNAME.massif -q" ;
-           shift ;;
-	--) shift ; break ;;
-	*) break ;;
-    esac
-done
-
-  $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  -c -C $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=433290";
-  exit 1
-fi
-
-! grep -i my 433290.h || exit 1
-
-if [ "xno" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
-  fi
-else
-  echo ""
-  [ "xno" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"
-  [ "xno" = "xno" ] && rm -rf 433290.o
-fi
+function test_compile_check {
+    ! grep -i my433290 $H433290 || test_fail
+}
 
+TESTRUN=no
+VALAFLAGS="-C -H $H433290"
+. test-common.sh
diff --git a/tests/bugs/433290.vala b/tests/bugs/433290.vala
index e2a4b8a..1bb6bf9 100644
--- a/tests/bugs/433290.vala
+++ b/tests/bugs/433290.vala
@@ -1,5 +1,5 @@
-delegate void My.Callback (uint j, void *data);
+delegate void My433290.Callback (uint j, void *data);
 
-class My.Class {
+class My433290.Class {
 	public void apply(Callback cb, void *user_data) { }
 }
diff --git a/tests/bugs/433296.test b/tests/bugs/433296.test
index e051157..8c65445 100755
--- a/tests/bugs/433296.test
+++ b/tests/bugs/433296.test
@@ -1,57 +1,3 @@
-#!/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=""
-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 -q" ;
-           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=433296";
-  exit 1
-fi
-
-true || exit 1
-
-if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $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 433296.o
-fi
+#!/bin/bash
 
+. test-common.sh
diff --git a/tests/bugs/434503.test b/tests/bugs/434503.test
index 3b5ce99..522fe9b 100755
--- a/tests/bugs/434503.test
+++ b/tests/bugs/434503.test
@@ -1,57 +1,4 @@
-#!/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=""
-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 -q" ;
-           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=434503";
-  exit 1
-fi
-
-true || exit 1
-
-if [ "xno" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
-  fi
-else
-  echo ""
-  [ "xno" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"
-  [ "xno" = "xno" ] && rm -rf 434503.o
-fi
+#!/bin/bash
 
+VALACEXIT=1
+. test-common.sh
diff --git a/tests/bugs/434506.test b/tests/bugs/434506.test
index a778746..8c65445 100755
--- a/tests/bugs/434506.test
+++ b/tests/bugs/434506.test
@@ -1,57 +1,3 @@
-#!/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=""
-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 -q" ;
-           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=434506";
-  exit 1
-fi
-
-true || exit 1
-
-if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $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 434506.o
-fi
+#!/bin/bash
 
+. test-common.sh
diff --git a/tests/bugs/434507.test b/tests/bugs/434507.test
index 5aa614e..8c65445 100755
--- a/tests/bugs/434507.test
+++ b/tests/bugs/434507.test
@@ -1,57 +1,3 @@
-#!/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=""
-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 -q" ;
-           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=434507";
-  exit 1
-fi
-
-true || exit 1
-
-if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $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 434507.o
-fi
+#!/bin/bash
 
+. test-common.sh
diff --git a/tests/bugs/434514.test b/tests/bugs/434514.test
index 97fb251..522fe9b 100755
--- a/tests/bugs/434514.test
+++ b/tests/bugs/434514.test
@@ -1,57 +1,4 @@
-#!/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=""
-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 -q" ;
-           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=434514";
-  exit 1
-fi
-
-true || exit 1
-
-if [ "xno" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
-  fi
-else
-  echo ""
-  [ "xno" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"
-  [ "xno" = "xno" ] && rm -rf 434514.o
-fi
+#!/bin/bash
 
+VALACEXIT=1
+. test-common.sh
diff --git a/tests/bugs/434929.test b/tests/bugs/434929.test
index 31fffad..8c65445 100755
--- a/tests/bugs/434929.test
+++ b/tests/bugs/434929.test
@@ -1,57 +1,3 @@
-#!/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=""
-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 -q" ;
-           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=434929";
-  exit 1
-fi
-
-true || exit 1
-
-if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $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 434929.o
-fi
+#!/bin/bash
 
+. test-common.sh
diff --git a/tests/bugs/435848.test b/tests/bugs/435848.test
index 90605d4..fcf5b0a 100755
--- a/tests/bugs/435848.test
+++ b/tests/bugs/435848.test
@@ -1,57 +1,4 @@
-#!/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=""
-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 -q" ;
-           shift ;;
-	--) shift ; break ;;
-	*) break ;;
-    esac
-done
-
-  $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  -X -Wall $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=435848";
-  exit 1
-fi
-
-true || exit 1
-
-if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $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 435848.o
-fi
+#!/bin/bash
 
+VALAFLAGS="-X -Wall"
+. test-common.sh
diff --git a/tests/bugs/435853.test b/tests/bugs/435853.test
index dd158af..522fe9b 100755
--- a/tests/bugs/435853.test
+++ b/tests/bugs/435853.test
@@ -1,57 +1,4 @@
-#!/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=""
-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 -q" ;
-           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=435853";
-  exit 1
-fi
-
-true || exit 1
-
-if [ "xno" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
-  fi
-else
-  echo ""
-  [ "xno" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"
-  [ "xno" = "xno" ] && rm -rf 435853.o
-fi
+#!/bin/bash
 
+VALACEXIT=1
+. test-common.sh
diff --git a/tests/bugs/435854.test b/tests/bugs/435854.test
index fa9aab5..7e33abb 100755
--- a/tests/bugs/435854.test
+++ b/tests/bugs/435854.test
@@ -1,57 +1,5 @@
-#!/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=""
-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 -q" ;
-           shift ;;
-	--) shift ; break ;;
-	*) break ;;
-    esac
-done
-
-!  $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  -C $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=435854";
-  exit 1
-fi
-
-true || exit 1
-
-if [ "xno" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
-  fi
-else
-  echo ""
-  [ "xno" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"
-  [ "xno" = "xno" ] && rm -rf 435854.o
-fi
+#!/bin/bash
 
+VALACEXIT=1
+VALAFLAGS="-C"
+. test-common.sh
diff --git a/tests/bugs/436011.test b/tests/bugs/436011.test
index e951b90..c17db80 100755
--- a/tests/bugs/436011.test
+++ b/tests/bugs/436011.test
@@ -1,57 +1,4 @@
-#!/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=""
-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 -q" ;
-           shift ;;
-	--) shift ; break ;;
-	*) break ;;
-    esac
-done
-
-  $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  -c -X -m64 -X -Wall -X -Werror $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=436011";
-  exit 1
-fi
-
-true || exit 1
-
-if [ "xno" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
-  fi
-else
-  echo ""
-  [ "xno" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"
-  [ "xno" = "xno" ] && rm -rf 436011.o
-fi
+#!/bin/bash
 
+VALAFLAGS="-X -m64 -X -Wall -X -Werror"
+. test-common.sh
diff --git a/tests/bugs/436760.test b/tests/bugs/436760.test
index 08bda62..1cd0e27 100755
--- a/tests/bugs/436760.test
+++ b/tests/bugs/436760.test
@@ -1,57 +1,9 @@
-#!/bin/sh
+#!/bin/bash
 
-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=""
-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 -q" ;
-           shift ;;
-	--) shift ; break ;;
-	*) break ;;
-    esac
-done
-
-  $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  -c -C $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=436760";
-  exit 1
-fi
-
-grep -q input_stream_ftp 436760.c || exit 1
-
-if [ "xno" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
-  fi
-else
-  echo ""
-  [ "xno" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"
-  [ "xno" = "xno" ] && rm -rf 436760.o
-fi
+function test_compile_check {
+    grep -q input_stream_ftp 436760.c || test_fail
+}
 
+TESTRUN=no
+VALAFLAGS="-C"
+. test-common.sh
diff --git a/tests/bugs/436761.test b/tests/bugs/436761.test
index e30706c..8c65445 100755
--- a/tests/bugs/436761.test
+++ b/tests/bugs/436761.test
@@ -1,57 +1,3 @@
-#!/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=""
-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 -q" ;
-           shift ;;
-	--) shift ; break ;;
-	*) break ;;
-    esac
-done
-
-  $VALAC  --pkg libxml-2.0 -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=436761";
-  exit 1
-fi
-
-true || exit 1
-
-if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $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 436761.o
-fi
+#!/bin/bash
 
+. test-common.sh
diff --git a/tests/bugs/437431.test b/tests/bugs/437431.test
index bfbc8ac..522fe9b 100755
--- a/tests/bugs/437431.test
+++ b/tests/bugs/437431.test
@@ -1,57 +1,4 @@
-#!/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=""
-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 -q" ;
-           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=437431";
-  exit 1
-fi
-
-true || exit 1
-
-if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $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 437431.o
-fi
+#!/bin/bash
 
+VALACEXIT=1
+. test-common.sh
diff --git a/tests/bugs/437434.test b/tests/bugs/437434.test
index 0794ef2..8c65445 100755
--- a/tests/bugs/437434.test
+++ b/tests/bugs/437434.test
@@ -1,57 +1,3 @@
-#!/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=""
-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 -q" ;
-           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=437434";
-  exit 1
-fi
-
-true || exit 1
-
-if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $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 437434.o
-fi
+#!/bin/bash
 
+. test-common.sh
diff --git a/tests/bugs/437435.test b/tests/bugs/437435.test
index 0d867be..8c65445 100755
--- a/tests/bugs/437435.test
+++ b/tests/bugs/437435.test
@@ -1,57 +1,3 @@
-#!/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=""
-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 -q" ;
-           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=437435";
-  exit 1
-fi
-
-true || exit 1
-
-if [ "x1" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $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 437435.o
-fi
+#!/bin/bash
 
+. test-common.sh
diff --git a/tests/bugs/442703.test b/tests/bugs/442703.test
index ea1c3af..8c65445 100755
--- a/tests/bugs/442703.test
+++ b/tests/bugs/442703.test
@@ -1,57 +1,3 @@
-#!/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=""
-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 -q" ;
-           shift ;;
-	--) shift ; break ;;
-	*) break ;;
-    esac
-done
-
-  $VALAC  --pkg gtk+-2.0 -o $TESTNAME $SRCDIR/$TESTNAME.vala  -c $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=442703";
-  exit 1
-fi
-
-true || exit 1
-
-if [ "xno" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
-  fi
-else
-  echo ""
-  [ "xno" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"
-  [ "xno" = "xno" ] && rm -rf 442703.o
-fi
+#!/bin/bash
 
+. test-common.sh
diff --git a/tests/bugs/443514.test b/tests/bugs/443514.test
index 241ab4b..8c65445 100755
--- a/tests/bugs/443514.test
+++ b/tests/bugs/443514.test
@@ -1,57 +1,3 @@
-#!/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=$TESTNAME.massif -q" ;
-           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 "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $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
+#!/bin/bash
 
+. test-common.sh
diff --git a/tests/bugs/516287.test b/tests/bugs/516287.test
index 82d4daa..8c65445 100755
--- a/tests/bugs/516287.test
+++ b/tests/bugs/516287.test
@@ -1,17 +1,3 @@
-#!/bin/sh
-
-set -e
-
-SRCDIR=../tests/bugs
-
-if [ "x$VALAC" = "x" ] ; then
-  VALAC=valac
-  SRCDIR=.
-fi
-
-TESTNAME=`basename $0 .test`
-
-$VALAC -o $TESTNAME $SRCDIR/$TESTNAME.vala $VALAFLAGS
-
-G_DEBUG=fatal_warnings ./$TESTNAME  $@
+#!/bin/bash
 
+. test-common.sh
diff --git a/tests/bugs/536863.test b/tests/bugs/536863.test
index 344b78b..8c65445 100755
--- a/tests/bugs/536863.test
+++ b/tests/bugs/536863.test
@@ -1,16 +1,3 @@
-#!/bin/sh
+#!/bin/bash
 
-set -e
-
-SRCDIR=../tests/bugs
-
-if [ "x$VALAC" = "x" ] ; then
-  VALAC=valac
-  SRCDIR=.
-fi
-
-TESTNAME=`basename $0 .test`
-
-$VALAC -o $TESTNAME $SRCDIR/$TESTNAME.vala $VALAFLAGS
-
-G_DEBUG=fatal_warnings ./$TESTNAME  $@
+. test-common.sh
diff --git a/tests/bugs/539969.test b/tests/bugs/539969.test
index d47a6bf..8c65445 100755
--- a/tests/bugs/539969.test
+++ b/tests/bugs/539969.test
@@ -1,17 +1,3 @@
-#!/bin/sh
-
-set -e
-
-SRCDIR=../tests/bugs
-
-if [ "x$VALAC" = "x" ] ; then
-  VALAC=valac
-  SRCDIR=.
-fi
-
-TESTNAME=`basename $0 .test`
-
-$VALAC --pkg gee-1.0 -o $TESTNAME $SRCDIR/$TESTNAME.vala $VALAFLAGS
-
-G_DEBUG=fatal_warnings ./$TESTNAME  $@
+#!/bin/bash
 
+. test-common.sh
diff --git a/tests/bugs/539969.vala b/tests/bugs/539969.vala
index dff5588..3bf1d85 100644
--- a/tests/bugs/539969.vala
+++ b/tests/bugs/539969.vala
@@ -26,7 +26,7 @@ public class Test : GLib.Object {
         this.numbers = new Sequence<Number> (null);
     }
     
-    public void add (Number# n) {
+    public void add (owned Number n) {
     	SequenceIter<Number> iter = this.numbers.insert_sorted (n, Number.compare);
 		this.event_id_map.set (n.Value, iter);
 		
@@ -45,17 +45,17 @@ public class Test : GLib.Object {
 		numbers[5] = new Number (128359);
 		numbers[6] = new Number (0);
 		
-		t.add (#numbers[0]);
-		t.add (#numbers[1]);
-		t.add (#numbers[2]);
-		t.add (#numbers[3]);
-		t.add (#numbers[4]);
-		t.add (#numbers[5]);
-		t.add (#numbers[6]);
+		t.add ((owned)numbers[0]);
+		t.add ((owned)numbers[1]);
+		t.add ((owned)numbers[2]);
+		t.add ((owned)numbers[3]);
+		t.add ((owned)numbers[4]);
+		t.add ((owned)numbers[5]);
+		t.add ((owned)numbers[6]);
 		
 		assert (t.event_id_map.size == 7);
 		assert (t.numbers.get_length () == 7);
-		foreach (int i in t.event_id_map.get_keys ()) {
+		foreach (int i in t.event_id_map.keys) {
 			SequenceIter<Number> iter = t.event_id_map.get (i);
 			Number n = t.numbers.get (iter);
 			assert (n.Value == i);
diff --git a/tests/bugs/548442.test b/tests/bugs/548442.test
index 82d4daa..8c65445 100755
--- a/tests/bugs/548442.test
+++ b/tests/bugs/548442.test
@@ -1,17 +1,3 @@
-#!/bin/sh
-
-set -e
-
-SRCDIR=../tests/bugs
-
-if [ "x$VALAC" = "x" ] ; then
-  VALAC=valac
-  SRCDIR=.
-fi
-
-TESTNAME=`basename $0 .test`
-
-$VALAC -o $TESTNAME $SRCDIR/$TESTNAME.vala $VALAFLAGS
-
-G_DEBUG=fatal_warnings ./$TESTNAME  $@
+#!/bin/bash
 
+. test-common.sh
diff --git a/tests/bugs/556881.test b/tests/bugs/556881.test
index 868b1bb..522fe9b 100755
--- a/tests/bugs/556881.test
+++ b/tests/bugs/556881.test
@@ -1,57 +1,4 @@
-#!/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=""
-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 -q" ;
-           shift ;;
-	--) shift ; break ;;
-	*) break ;;
-    esac
-done
-
-!  $VALAC  -o $TESTNAME $SRCDIR/$TESTNAME.vala  -C $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=556881";
-  exit 1
-fi
-
-true || exit 1
-
-if [ "xno" = "x1" -o "x$INTERACT" = "x1" ] ; then
-  if [ -z $VALGRIND ] ; then
-    sh -c "$TESTENV ./$TESTNAME  $@"
-  else
-    sh -c "$VALGRINDENV $TESTENV $VALGRIND $VALGRINDFLAGS ./$TESTNAME  $@"
-  fi
-else
-  echo ""
-  [ "xno" = "x0" ] && echo "*** WARNING: This vala test is interactive and will not be run (try --interact) ***"
-  [ "xno" = "xno" ] && rm -rf 556881.o
-fi
+#!/bin/bash
 
+VALACEXIT=1
+. test-common.sh
diff --git a/tests/bugs/571960.test b/tests/bugs/571960.test
new file mode 100755
index 0000000..522fe9b
--- /dev/null
+++ b/tests/bugs/571960.test
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+VALACEXIT=1
+. test-common.sh
diff --git a/tests/bugs/576122.test b/tests/bugs/576122.test
new file mode 100755
index 0000000..522fe9b
--- /dev/null
+++ b/tests/bugs/576122.test
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+VALACEXIT=1
+. test-common.sh



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