4 # Copyright (C) 2006-2008 Jürg Billeter
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 # Jürg Billeter <j@bitron.ch>
24 topbuilddir
=$builddir/..
27 vapidir
=$topsrcdir/vapi
30 # make sure we detect failed test cases
33 export G_DEBUG
=fatal_warnings
35 VALAC
=$topbuilddir/compiler
/valac
37 CFLAGS
="-O0 -g3 -I$topsrcdir -I$topbuilddir"
38 LDLIBS
="-lm ../gee/.libs/libgee.a"
42 for testcasesource
in "$@"
44 testsrc
=${testcasesource/.vala/}
45 testbuild
=`basename "$testsrc"`
46 if ! $VALAC -C --vapidir "$vapidir" --pkg gee-1.0
--basedir $topsrcdir -d $topbuilddir $testsrc.vala
> $testbuild.err
2>&1
48 echo "ERROR: Compiling" $testcasesource
53 if ! $CC $CFLAGS $testbuild.c $
(pkg-config
--cflags --libs gobject-2.0
) -o $testbuild $LDLIBS > $testbuild.err
2>&1
55 echo "ERROR: Compiling" $testbuild.c
60 if .
/$testbuild 2>&1 |
tee $testbuild.err |
cmp -s $testsrc.exp
62 rm $testbuild.c
$testbuild.h
$testbuild$exe $testbuild.err
64 echo "ERROR: test failed. This is the difference between" $testbuild.exp
"and" $testbuild.err
65 diff -u $testbuild.exp
$testbuild.err