[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/8] tests: enhance tests on AM_PROG_VALAC
From: |
Stefano Lattarini |
Subject: |
[PATCH 3/8] tests: enhance tests on AM_PROG_VALAC |
Date: |
Sat, 27 Oct 2012 09:22:40 +0200 |
* t/vala4.sh: Here.
Signed-off-by: Stefano Lattarini <address@hidden>
---
t/vala4.sh | 82 +++++++++++++++++++++++++++++++++++++++++++-------------------
1 file changed, 57 insertions(+), 25 deletions(-)
diff --git a/t/vala4.sh b/t/vala4.sh
index 60cb79c..0b87ca0 100755
--- a/t/vala4.sh
+++ b/t/vala4.sh
@@ -20,53 +20,85 @@
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_VALAC([0.0.1])
+AM_PROG_VALAC([1.2.3])
AC_OUTPUT
END
-: > Makefile.am
+cat > Makefile.am << 'END'
+has-valac:
+ case '$(VALAC)' in *valac) exit 0;; *) exit 1;; esac
+no-valac:
+ test x'$(VALAC)' = x':'
+END
-cat > valac << 'END'
+mkdir bin
+cat > bin/valac << 'END'
#! /bin/sh
if test "x$1" = x--version; then
- echo 1.2.3
+ echo "${vala_version-1.2.3}"
fi
exit 0
END
-chmod +x valac
+chmod +x bin/valac
-cwd=$(pwd) || fatal_ "getting current working directory"
+cat > bin/valac.old << 'END'
+#! /bin/sh
+if test "x$1" = x--version; then
+ echo 0.1
+fi
+exit 0
+END
+chmod +x bin/valac.old
+
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
+
+# Avoid interferences from the environment.
+VALAC= vala_version=; unset VALAC vala_version
$ACLOCAL
$AUTOMAKE -a
$AUTOCONF
-# The "|| exit 1" is required here even if 'set -e' is active,
+# The "|| exit 1" are required here even if 'set -e' is active,
# because ./configure might exit with status 77, and in that case
# we want to FAIL, not to SKIP.
-./configure "VALAC=$cwd/valac" || exit 1
+./configure || exit 1
+$MAKE has-valac
+vala_version=99.9 ./configure || exit 1
+$MAKE has-valac
-sed 's/AM_PROG_VALAC.*/AM_PROG_VALAC([9999.9])/' < configure.ac >t
-mv -f t configure.ac
-$AUTOCONF --force
-st=0; ./configure "VALAC=$cwd/valac" || st=$?
+st=0; vala_version=0.1.2 ./configure 2>stderr || st=$?
+cat stderr >&2
test $st -eq 77 || exit 1
+#$MAKE no-valac
-sed 's/AM_PROG_VALAC.*/AM_PROG_VALAC([1.2.3])/' < configure.ac >t
-mv -f t configure.ac
-$AUTOCONF --force
-# See comments above for why "|| exit 1" is needed.
-./configure "VALAC=$cwd/valac" || exit 1
+st=0; ./configure VALAC="$(pwd)/bin/valac.old" 2>stderr || st=$?
+cat stderr >&2
+test $st -eq 77 || exit 1
+#$MAKE no-valac
-sed 's/AM_PROG_VALAC.*/AM_PROG_VALAC([9999.9], , [:])/' < configure.ac >t
+sed 's/^\(AM_PROG_VALAC\).*/\1([1], [: > ok], [: > ko])/' <configure.ac >t
mv -f t configure.ac
-$AUTOCONF --force
-./configure "VALAC=$cwd/valac" || exit 1
+rm -rf autom4te*.cache
+$ACLOCAL
+$AUTOCONF
-sed 's/AM_PROG_VALAC.*/AM_PROG_VALAC([1.2.3], [exit 77])/' < configure.ac >t
-mv -f t configure.ac
-$AUTOCONF --force
-st=0; ./configure "VALAC=$cwd/valac" || st=$?
-test $st -eq 77 || exit 1
+./configure
+test -f ok
+test ! -e ko
+$MAKE has-valac
+rm -f ok ko
+
+vala_version=0.1.2 ./configure
+test ! -e ok
+test -f ko
+$MAKE no-valac
+rm -f ok ko
+
+./configure VALAC="$(pwd)/bin/valac.old"
+test ! -e ok
+test -f ko
+$MAKE no-valac
+rm -f ok ko
:
--
1.8.0
- [PATCH 0/8] Vala support: some fixlets, improvements and tweaks, Stefano Lattarini, 2012/10/27
- [PATCH 1/8] vala: add action arguments, for when no proper vala compiler is found, Stefano Lattarini, 2012/10/27
- [PATCH 2/8] vala: style fixes in vala.m4, Stefano Lattarini, 2012/10/27
- [PATCH 3/8] tests: enhance tests on AM_PROG_VALAC,
Stefano Lattarini <=
- [PATCH 4/8] docs: document recent changes to AM_PROG_VALAC, Stefano Lattarini, 2012/10/27
- [PATCH 5/8] vala: AM_PROG_VALAC should not produce an error for tool-old valac, Stefano Lattarini, 2012/10/27
- [PATCH 6/8] vala: if no proper compiler found, set $(VALAC) to 'valac', Stefano Lattarini, 2012/10/27
- [PATCH 7/8] news: update w.r.t. recent vala changes, Stefano Lattarini, 2012/10/27
- [PATCH 8/8] vala: improve comments to AM_PROG_VALAC, Stefano Lattarini, 2012/10/27
- Re: [PATCH 0/8] Vala support: some fixlets, improvements and tweaks, Stefano Lattarini, 2012/10/31