~ubuntu-branches/ubuntu/hardy/vala/hardy

« back to all changes in this revision

Viewing changes to tests/testrunner.sh

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge, Marc-Andre Lureau, Sebastian Dröge
  • Date: 2007-10-15 14:37:51 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071015143751-zy7hqcyjutdyfkg3
Tags: 0.1.4-1
[ Marc-Andre Lureau ]
* New Upstream Version
* debian/patches:
  + Remove patch no longer needed in 0.1.4
* debian/rules
  + Add xsltproc build dependency for the Vala manual.
  + Add libenchant-dev build dependency for enchant test case.
* debian/control, debian/vala-doc.install:
  + Add a "vala-doc" documentation package.

[ Sebastian Dröge ]
* debian/control:
  + Let vala-doc suggest valac/devhelp and don't depend on libvala0.
* debian/libvala-dev.install:
  + Add the new vapicheck utility.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/bash
2
2
# testrunner.sh
3
3
#
4
 
# Copyright (C) 2006  Jürg Billeter
 
4
# Copyright (C) 2006-2007  Jürg Billeter
5
5
#
6
6
# This library is free software; you can redistribute it and/or
7
7
# modify it under the terms of the GNU Lesser General Public
8
8
# License as published by the Free Software Foundation; either
9
 
# version 2 of the License, or (at your option) any later version.
 
9
# version 2.1 of the License, or (at your option) any later version.
10
10
#
11
11
# This library is distributed in the hope that it will be useful,
12
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
20
20
# Author:
21
21
#       Jürg Billeter <j@bitron.ch>
22
22
 
23
 
builddir=$(dirname $0)
 
23
builddir=$PWD
24
24
topbuilddir=$builddir/..
25
 
vapidir=$topbuilddir/vapi
 
25
srcdir=`dirname $0`
 
26
topsrcdir=$srcdir/..
 
27
vapidir=$topsrcdir/vapi
 
28
 
 
29
export G_DEBUG=fatal_warnings
26
30
 
27
31
VALAC=$topbuilddir/compiler/valac
28
32
CC="gcc -std=c99"
29
 
CFLAGS="-O0 -g3"
30
 
LDLIBS="-lm"
 
33
CFLAGS="-O0 -g3 -I$topsrcdir -I$topbuilddir"
 
34
LDLIBS="-lm ../gee/.libs/libgee.a"
31
35
 
32
36
CODE=0
33
37
 
34
38
for testcasesource in "$@"
35
39
do
36
 
        testcase=${testcasesource/.vala/}
37
 
        if ! $VALAC --vapidir "$vapidir" $testcase.vala > $testcase.err 2>&1 
38
 
        then
39
 
                CODE=1
40
 
                continue
41
 
        fi
42
 
        if ! $CC $CFLAGS $(pkg-config --cflags --libs gobject-2.0) $LDLIBS -o $testcase $testcase.c > $testcase.err 2>&1 
43
 
        then
44
 
                CODE=1
45
 
                continue
46
 
        fi
47
 
        if ./$testcase | tee $testcase.err | cmp -s $testcase.out 
48
 
        then
49
 
                rm $testcase.err
 
40
        testsrc=${testcasesource/.vala/}
 
41
        testbuild=`basename "$testsrc"`
 
42
        if ! $VALAC --vapidir "$vapidir" --pkg gee-1.0 --basedir $topsrcdir -d $topbuilddir $testsrc.vala > $testbuild.err 2>&1
 
43
        then
 
44
                CODE=1
 
45
                continue
 
46
        fi
 
47
        if ! $CC $CFLAGS $(pkg-config --cflags --libs gobject-2.0) -o $testbuild $testbuild.c $LDLIBS > $testbuild.err 2>&1
 
48
        then
 
49
                CODE=1
 
50
                continue
 
51
        fi
 
52
        if ./$testbuild | tee $testbuild.err | cmp -s $testsrc.exp
 
53
        then
 
54
                rm $testbuild.c $testbuild.h $testbuild $testbuild.err
50
55
        else
51
56
                CODE=1
52
57
        fi