tests: give few vala tests more significant names
[automake.git] / t / vala-headers.sh
blob79a7b27c801e143600076842472204800c3c7d51
1 #! /bin/sh
2 # Copyright (C) 1996-2012 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Test to make sure compiling Vala code really works with recursive make.
19 required="pkg-config valac gcc GNUmake"
20 . test-init.sh
22 cat >> configure.ac << 'END'
23 AC_PROG_CC
24 AM_PROG_VALAC([0.7.0])
25 PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.4])
26 AC_OUTPUT
27 END
29 cat > Makefile.am << 'END'
30 bin_PROGRAMS = zardoz quux
32 zardoz_SOURCES = zardoz.vala
33 quux_SOURCES = quux.vala
34 quux.vala: zardoz.vala
35 sed 's/Zardoz/Quux/' <zardoz.vala >quux.vala
37 quux_VALAFLAGS = \
38 --header HDR.h \
39 --vapi hello.vapi
41 zardoz_VALAFLAGS = \
42 -H foo.h \
43 --internal-header foo2.h \
44 --internal-vapi foo3.vapi
46 AM_CFLAGS = $(GOBJECT_CFLAGS)
47 LDADD = $(GOBJECT_LIBS)
48 END
50 headers='HDR.h hello.vapi foo.h foo2.h foo3.vapi'
52 cat > zardoz.vala << 'END'
53 using GLib;
54 public class Zardoz {
55 public static void main () {
56 stdout.printf ("Zardoz!\n");
59 END
61 $ACLOCAL
62 $AUTOCONF
63 $AUTOMAKE -a
65 grep PKG_CHECK_MODULES configure && skip_ "pkg-config m4 macros not found"
67 ./configure
68 $MAKE
70 # Test rebuild rules.
72 for h in $headers; do
73 rm -f $h
74 $MAKE $h
75 test -f $h
76 done
78 rm -f $headers
79 $MAKE $headers
80 for h in $headers; do test -f $h; done
82 $MAKE distcheck
84 $MAKE maintainer-clean
85 for h in $headers; do test ! -e $h; done