* 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 | 10 ++++++++++ tests/javaprim.test | 13 ++++++++++--- tests/javasubst.test | 17 ++++++++++++----- 3 files changed, 32 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 0518868..50dfd16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2011-04-23 Stefano Lattarini <[email protected]> + 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 <[email protected]> + java coverage: add test on uninstall with JAVA primary * tests/java-uninstall.test: New test. * tests/Makefile.am (TESTS): Update. diff --git a/tests/javaprim.test b/tests/javaprim.test index aa1506b..53d7ac2 100755 --- a/tests/javaprim.test +++ b/tests/javaprim.test @@ -14,16 +14,23 @@ # 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 + +: diff --git a/tests/javasubst.test b/tests/javasubst.test index d018645..483da81 100755 --- a/tests/javasubst.test +++ b/tests/javasubst.test @@ -14,18 +14,25 @@ # 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 +: -- 1.7.2.3
