* tests/javaflags.test: New test. * tests/Makefile.am (TESTS): Update. --- ChangeLog | 6 +++++ tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/javaflags.test | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 0 deletions(-) create mode 100755 tests/javaflags.test
diff --git a/ChangeLog b/ChangeLog index 9c71828..0031f1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2011-04-26 Stefano Lattarini <[email protected]> + java coverage: test JAVACFLAGS and AM_JAVACFLAGS + * tests/javaflags.test: New test. + * tests/Makefile.am (TESTS): Update. + +2011-04-26 Stefano Lattarini <[email protected]> + java coverage: test rebuild rules for java * tests/java-rebuild.test: New test. * tests/Makefile.am (TESTS): Update. diff --git a/tests/Makefile.am b/tests/Makefile.am index 0e55109..de1dfda 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -436,6 +436,7 @@ java-check.test \ java-clean.test \ javaprim.test \ javasubst.test \ +javaflags.test \ java-extra.test \ java-noinst.test \ java-nobase.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index a0e6c70..db8a6c0 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -709,6 +709,7 @@ java-check.test \ java-clean.test \ javaprim.test \ javasubst.test \ +javaflags.test \ java-extra.test \ java-noinst.test \ java-nobase.test \ diff --git a/tests/javaflags.test b/tests/javaflags.test new file mode 100755 index 0000000..7564322 --- /dev/null +++ b/tests/javaflags.test @@ -0,0 +1,62 @@ +#! /bin/sh +# Copyright (C) 2011 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 <http://www.gnu.org/licenses/>. + +# Check support for $(JAVACFLAGS) and $(AM_JAVACFLAGS). + +. ./defs || Exit 1 + +set -e + +cat > fake-javac <<'END' +#!/bin/sh +echo "$*" > javaflags.list +END +chmod a+x fake-javac + +# Remove JAVAC from the environment, so that it won't interfere +# with `make -e' below. +unset JAVAC || : + +cat >> configure.in <<'END' +AC_PROG_CC +# Simulate presence of the java compiler using our fake-javac script. +AC_SUBST([JAVAC], ['$(abs_top_srcdir)'/fake-javac]) +AC_OUTPUT +END + +cat > Makefile.am <<'END' +foodir = $(prefix) +foo_JAVA = bar.java +AM_JAVACFLAGS = __am_flags__ +END + +$ACLOCAL +$AUTOMAKE + +grep '\$(JAVACFLAGS).*\$(AM_JAVACFLAGS)' Makefile.in && Exit 1 + +: > bar.java + +$AUTOCONF +./configure +env JAVACFLAGS=__user_flags__ $MAKE -e + +ls -l + +cat javaflags.list +grep '__am_flags__.*__user_flags__' javaflags.list + +: -- 1.7.2.3
