>From 072071c7d1c20fc1c85ee1e09796a08f6504d1d0 Mon Sep 17 00:00:00 2001 Message-Id: From: Stefano Lattarini Date: Thu, 12 Apr 2012 00:40:34 +0200 Subject: [PATCH 1/2] vala: test vapi files handling (still failing) 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 Signed-off-by: Marc-Antoine Perennou Signed-off-by: Stefano Lattarini --- THANKS | 1 + tests/list-of-tests.mk | 2 ++ tests/vala-vapi.test | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100755 tests/vala-vapi.test diff --git a/THANKS b/THANKS index a2091ab..e584fa7 100644 --- a/THANKS +++ b/THANKS @@ -215,6 +215,7 @@ Manu Rouat address@hidden Marcus Brinkmann address@hidden Marcus G. Daniels address@hidden Marius Vollmer address@hidden +Marc-Antoine Perennou address@hidden Mark D. Baushke address@hidden Mark Eichin address@hidden Mark Elbrecht address@hidden diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk index 2548174..8367312 100644 --- a/tests/list-of-tests.mk +++ b/tests/list-of-tests.mk @@ -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 index 0000000..46e0dd4 --- /dev/null +++ b/tests/vala-vapi.test @@ -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 . + +# 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 + +: -- 1.7.9.5