From 1dc51483660d23c255b95ad1c9e1d48e368f4b6c Mon Sep 17 00:00:00 2001
From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Date: Thu, 12 Apr 2012 00:13:01 +0200
Subject: [PATCH] vala: update vala2 test to test vapi files handling

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
---
 tests/vala2.test |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/tests/vala2.test b/tests/vala2.test
index cceed54..c224115 100755
--- a/tests/vala2.test
+++ b/tests/vala2.test
@@ -14,7 +14,8 @@
 # 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 to make sure compiling Vala code really works with recursive make.
+# Test to make sure compiling Vala code really works with recursive make
+# and that vapi files are correctly handled.
 
 required="libtool libtoolize pkg-config valac gcc GNUmake"
 . ./defs || Exit 1
@@ -40,7 +41,7 @@ bin_PROGRAMS = zardoz
 zardoz_VALAFLAGS = -H zardoz.h
 zardoz_CFLAGS = $(GOBJECT_CFLAGS)
 zardoz_LDADD = $(GOBJECT_LIBS)
-zardoz_SOURCES = zardoz.vala
+zardoz_SOURCES = zardoz.vala foo.vapi foo.h
 END
 
 cat > 'src/zardoz.vala' <<'END'
@@ -48,11 +49,20 @@ using GLib;
 
 public class Zardoz {
   public static void main () {
-    stdout.printf ("Zardoz!\n");
+    stdout.printf (BAR);
   }
 }
 END
 
+cat > 'src/foo.h' <<'END'
+#define BAR "Zardoz!\n"
+END
+
+cat > 'src/foo.vapi' <<'END'
+[CCode (cprefix="", lower_case_cprefix="", cheader_filename="foo.h")]
+public const string BAR;
+END
+
 libtoolize
 
 $ACLOCAL
-- 
1.7.9.1.244.gb0d66b.dirty

