news: describe recently-fixed bug in vala support
[platform/upstream/automake.git] / tests / vala.test
1 #! /bin/sh
2 # Copyright (C) 1996, 2001, 2002, 2006, 2008, 2009, 2012 Free Software
3 # Foundation, Inc.
4 #
5 # This file is part of GNU Automake.
6 #
7 # GNU Automake is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
11 #
12 # GNU Automake is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with Automake; see the file COPYING.  If not, write to
19 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 # Boston, MA 02110-1301, USA.
21
22 # Basic "grepping" test on vala support.
23
24 . ./defs || Exit 1
25
26 set -e
27
28 # So that we won't require libtool macros.
29 cat > acinclude.m4 <<'END'
30 AC_DEFUN([AC_PROG_LIBTOOL],
31          [AC_SUBST([LIBTOOL], [:])])
32 END
33
34 cat >> configure.in <<'END'
35 AC_PROG_CC
36 AC_PROG_CXX
37 AC_PROG_LIBTOOL
38 AM_PROG_VALAC
39 AC_CONFIG_FILES([sub/Makefile])
40 AC_OUTPUT
41 END
42
43 cat > Makefile.am <<'END'
44 SUBDIRS = sub
45
46 bin_PROGRAMS = zardoz
47 zardoz_SOURCES = zardoz.vala
48 zardoz_VALAFLAGS = --debug
49
50 lib_LTLIBRARIES = libzardoz.la
51 libzardoz_la_SOURCES = zardoz-foo.vala zardoz-bar.vala
52 END
53
54 mkdir sub
55
56 cat > sub/Makefile.am <<'END'
57 bin_PROGRAMS = foo
58 foo_SOURCES = bar.vala baz.vala mu.c zap.cxx
59 END
60
61 : > ltmain.sh
62 : > config.sub
63 : > config.guess
64
65 $ACLOCAL
66 $AUTOMAKE -a
67
68 grep '\$(VALAC).* \$(AM_VALAFLAGS) \$(VALAFLAGS) ' Makefile.in
69 grep '\$(VALAC).* \$(zardoz_VALAFLAGS) \$(VALAFLAGS) ' Makefile.in
70 $FGREP 'am_zardoz_OBJECTS' Makefile.in
71 $FGREP 'am_libzardoz_la_OBJECTS' Makefile.in
72 $FGREP 'zardoz_vala.stamp:' Makefile.in
73 $FGREP 'libzardoz_la_vala.stamp:' Makefile.in
74 test `$FGREP -c '.stamp:' Makefile.in` -eq 2
75 $FGREP 'zardoz.c' Makefile.in
76 $FGREP 'zardoz-foo.c' Makefile.in
77 $FGREP 'zardoz-bar.c' Makefile.in
78
79 grep '\$(VALAC).* \$(AM_VALAFLAGS) \$(VALAFLAGS) ' sub/Makefile.in
80 $FGREP 'foo_VALAFLAGS' sub/Makefile.in && Exit 1
81 $FGREP 'am_foo_OBJECTS' sub/Makefile.in
82 $FGREP 'bar.c' sub/Makefile.in
83 $FGREP 'baz.c' sub/Makefile.in
84 $FGREP 'foo_vala.stamp:' sub/Makefile.in
85 test `$FGREP -c '.stamp:' sub/Makefile.in` -eq 1
86
87 # Check against regression for weird bug due to unescaped '@'
88 # characters used in a "..." perl string when writing the vala
89 # rules from automake.in.
90 grep '\$[0-9][0-9]*t' Makefile.in sub/Makefile.in && Exit 1
91
92 :