java tests: tweak and make stricter a couple of tests
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 23 Apr 2011 17:10:15 +0000 (19:10 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 26 Apr 2011 15:25:22 +0000 (17:25 +0200)
* tests/javasubst.test: Use proper m4 quoting.  Add trailing `:'
command.  Enable `errexit' shell flag, and related changes.
Prefer cat + here-doc over echo to append to configure.in.
Make grepping of Makefile.in stricter.  Add debugging output.
Improve heading comments.
* tests/javaprim.test: Likewise.

ChangeLog
tests/javaprim.test
tests/javasubst.test

index 0518868..50dfd16 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2011-04-23  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
+       java tests: tweak and make stricter a couple of tests
+       * tests/javasubst.test: Use proper m4 quoting.  Add trailing `:'
+       command.  Enable `errexit' shell flag, and related changes.
+       Prefer cat + here-doc over echo to append to configure.in.
+       Make grepping of Makefile.in stricter.  Add debugging output.
+       Improve heading comments.
+       * tests/javaprim.test: Likewise.
+
+2011-04-23  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
        java coverage: add test on uninstall with JAVA primary
        * tests/java-uninstall.test: New test.
        * tests/Makefile.am (TESTS): Update.
index aa1506b..53d7ac2 100755 (executable)
 # 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 JAVA variable can be defined.
+# Test to make sure JAVA variable can be defined by AC_SUBST.
 
 . ./defs || Exit 1
 
-echo 'AC_SUBST(JAVA)' >> configure.in
+cat >> configure.in << 'END'
+AC_SUBST([JAVA])
+END
 
 cat > Makefile.am << 'END'
 javadir = $(datadir)/java
 java_JAVA = a.java b.java c.java
 END
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
+
+grep -i java Makefile.in # For debugging.
+grep '^JAVA = *@JAVA@ *$' Makefile.in
+
+:
index d018645..483da81 100755 (executable)
 # 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 redefining JAVAC works.
+# Test to make sure redefining JAVAC with AC_SUBST works.
 
 . ./defs || Exit 1
 
-echo 'AC_SUBST(JAVAC)' >> configure.in
+set -e
+
+cat >> configure.in << 'END'
+AC_SUBST([JAVAC])
+END
 
 cat > Makefile.am << 'END'
 javadir = $(datadir)/java
 java_JAVA = a.java b.java c.java
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
+grep -i java Makefile.in # For debugging.
+grep '^JAVAC = *@JAVAC@ *$' Makefile.in
 
-grep 'JAVAC.*@JAVAC@' Makefile.in
+: