]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
vala tests: some enhancements
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 16 Apr 2012 20:35:18 +0000 (22:35 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 16 Apr 2012 20:35:18 +0000 (22:35 +0200)
* t/vala-vpath.sh, t/vala2.sh, t/vala3.sh, t/vala5.sh: Enhance a little.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
t/vala-vpath.sh
t/vala2.sh
t/vala3.sh
t/vala5.sh

index e1e2e66e01c16fa234dafedeb70ed375a4e329fe..0d2e8c93725f93872107db3c9ba6f711357d8198 100755 (executable)
@@ -28,9 +28,11 @@ AC_OUTPUT
 END
 
 cat > Makefile.am <<'END'
-bin_PROGRAMS = foo
-foo_VALAFLAGS = --profile=posix
+bin_PROGRAMS = foo bar
+AM_VALAFLAGS = --profile=posix
 foo_SOURCES = hello.vala
+bar_VALAFLAGS = $(AM_VALAFLAGS) -H zardoz.h
+bar_SOURCES = $(foo_SOURCES)
 END
 
 cat > hello.vala <<'END'
@@ -49,10 +51,13 @@ cd build
 ../configure || Exit 77
 $MAKE
 test -f ../foo_vala.stamp
+test -f ../bar_vala.stamp
 grep foofoofoo ../hello.c
+test -f ../zardoz.h
 $MAKE distcheck
 
 # Rebuild rules work also in VPATH builds.
+
 cat > ../hello.vala <<'END'
 int main ()
 {
@@ -63,10 +68,23 @@ END
 
 $MAKE
 test -f ../foo_vala.stamp
+test -f ../bar_vala.stamp
 grep barbarbar ../hello.c
 
 # Rebuild rules are not uselessly triggered.
 $MAKE -q
 $MAKE -n | grep '\.stamp' && Exit 1
 
+# Cleanup rules work also in VPATH builds.
+$MAKE clean
+test -f ../foo_vala.stamp
+test -f ../bar_vala.stamp
+grep barbarbar ../hello.c
+$MAKE maintainer-clean
+# FIXME: Generated C files and stamp files doesn't get correctly
+# FIXME: cleaned in a VPATH build.
+#test ! -f ../hello.c
+#test ! -f ../foo_vala.stamp
+#test ! -f ../bar_vala.stamp
+
 :
index 2b140b5e088fef008f95587d71778cbf6aa7b0c7..7e93ff97a6d4d23b114c5e191784142bf52871ac 100755 (executable)
@@ -63,11 +63,28 @@ $AUTOMAKE -a
 $MAKE
 
 # Test rebuild rules.
+
 rm -f src/zardoz.h
 $MAKE -C src zardoz.h
+test -f src/zardoz.h
+rm -f src/zardoz.c
+$MAKE -C src
+test -f src/zardoz.c
+
+echo am--error > src/zardoz.h
+echo am--error > src/zardoz.c
+$sleep
+touch src/zardoz.vala
+$MAKE
+grep 'am--error' src/zardoz.[ch] && Exit 1
+
+# Check the distribution.
 
 $MAKE distcheck
 $MAKE distclean
+
+# Tru a VPATH setup.
+
 mkdir build
 cd build
 ../configure
@@ -75,11 +92,18 @@ $MAKE
 $MAKE distcheck
 
 # Test rebuild rules from builddir.
+
+rm -f ../src/zardoz.h
+$MAKE -C src ../../src/zardoz.h
+test -f ../src/zardoz.h
+
 rm -f ../src/zardoz.c
 $MAKE
 grep 'Zardoz!' ../src/zardoz.c
-sed 's/Zardoz!/FooBar!/' ../src/zardoz.c > t
-mv -f t ../src/zardoz.c
+
+$sleep
+sed 's/Zardoz!/FooBar!/' ../src/zardoz.vala > t
+mv -f t ../src/zardoz.vala
 $MAKE
 grep 'FooBar!' ../src/zardoz.c
 grep 'Zardoz!' ../src/zardoz.c && Exit 1
index af8fcb5bddb4c93998613b710c9f3d727f7a37dc..706753d63c664f163d751c7debdf0cb2212597d8 100755 (executable)
@@ -55,8 +55,13 @@ $AUTOMAKE -a
 
 ./configure || skip_ "configure failure"
 $MAKE
+test -f src/zardoz.c
+test -f src_zardoz_vala.stamp
 $MAKE distcheck
-$MAKE distclean
+$MAKE maintainer-clean
+test ! -f src/zardoz.c
+test ! -f src_zardoz_vala.stamp
+
 mkdir build
 cd build
 ../configure
index 26f391ad4f161d6a19abb0f7f6b7347689c54b6a..0c45d1e689d43a3380d46d90b0e83e0618adda3d 100755 (executable)
@@ -80,4 +80,24 @@ if cross_compiling; then :; else
   test `./src/bar` = bar
 fi
 
+# Test clean rules.
+
+cp config.status config.sav
+
+$MAKE clean
+test -f src/xfoo.c
+test -f src/xbar.c
+
+$MAKE distclean
+test -f src/xfoo.c
+test -f src/xbar.c
+
+# Re-create Makefile.
+mv config.sav config.status
+./config.status
+
+$MAKE maintainer-clean
+test ! -f src/xfoo.c
+test ! -f src/xbar.c
+
 :