vala: test vapi files handling (still failing)
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 11 Apr 2012 22:40:34 +0000 (00:40 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 11 Apr 2012 23:23:37 +0000 (01:23 +0200)
Exposes automake bug#11222.

* tests/vala-vapi.test: New test, still failing.
* tests/list-of-tests.mk (handwritten_TESTS): Add it.
(XFAIL_TESTS): Likewise.
* THANKS: Update.

Copyright-paperwork-exempt: yes
Co-authored-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
THANKS
tests/list-of-tests.mk
tests/vala-vapi.test [new file with mode: 0755]

diff --git a/THANKS b/THANKS
index a2091ab3c1df148c79c1b4b3f2814026173e6d52..e584fa7a34cc959e8622955183bc93092ccceae8 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -215,6 +215,7 @@ Manu Rouat          emmanuel.rouat@wanadoo.fr
 Marcus Brinkmann       Marcus.Brinkmann@ruhr-uni-bochum.de
 Marcus G. Daniels      mgd@ute.santafe.edu
 Marius Vollmer         mvo@zagadka.ping.de
+Marc-Antoine Perennou  Marc-Antoine@Perennou.com
 Mark D. Baushke                mdb@cvshome.org
 Mark Eichin            eichin@cygnus.com
 Mark Elbrecht          snowball3@bigfoot.com
index 2548174df6351e95d2a9229f72db8736321feaaa..83673129ca5aefcb7a840c403e9722c9a900f5bb 100644 (file)
@@ -32,6 +32,7 @@ pr8365-remake-timing.test \
 lex-subobj-nodep.test \
 remake-am-pr10111.test \
 remake-m4-pr10111.test \
+vala-vapi.test \
 txinfo5.test
 
 perl_TESTS = \
@@ -929,6 +930,7 @@ vala2.test \
 vala3.test \
 vala4.test \
 vala5.test \
+vala-vapi.test \
 vala-vpath.test \
 vala-mix.test \
 vala-mix2.test \
diff --git a/tests/vala-vapi.test b/tests/vala-vapi.test
new file mode 100755 (executable)
index 0000000..46e0dd4
--- /dev/null
@@ -0,0 +1,91 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Test and that vapi files are correctly handled by Vala support.
+
+required='valac cc GNUmake'
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in <<'END'
+AC_PROG_CC
+AM_PROG_CC_C_O
+AM_PROG_VALAC([0.7.3])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = zardoz
+AM_VALAFLAGS = --profile=posix
+zardoz_SOURCES = zardoz.vala foo.vapi foo.h
+END
+
+cat > zardoz.vala <<'END'
+int main ()
+{
+    stdout.printf (BARBAR);
+    return 0;
+}
+END
+
+echo '#define BARBAR "Zardoz!\n"' > foo.h
+
+cat > foo.vapi <<'END'
+[CCode (cprefix="", lower_case_cprefix="", cheader_filename="foo.h")]
+public const string BARBAR;
+END
+
+if cross_compiling; then :; else
+  unindent >> Makefile.am <<'END'
+    check-local: test2
+    .PHONY: test1 test2
+    test1:
+       ./zardoz
+       ./zardoz | grep 'Zardoz!'
+    test2:
+       ./zardoz
+       ./zardoz | grep 'Quux!'
+END
+fi
+
+$ACLOCAL
+$AUTOMAKE -a
+$AUTOCONF
+
+./configure --enable-dependency-tracking
+
+$MAKE
+ls -l        # For debugging.
+cat zardoz.c # Likewise.
+grep 'BARBAR' zardoz.c
+$MAKE test1
+
+# Simple check on remake rules.
+$sleep
+echo '#define BAZBAZ "Quux!\n"' > foo.h
+sed 's/BARBAR/BAZBAZ/' zardoz.vala > t && mv -f t zardoz.vala || Exit 99
+$MAKE && Exit 1
+sed 's/BARBAR/BAZBAZ/' foo.vapi > t && mv -f t foo.vapi || Exit 99
+$MAKE
+cat zardoz.c # For debugging.
+grep 'BAZBAZ' zardoz.c
+$MAKE test2
+
+# Check the distribution.
+$MAKE distcheck
+
+: