# But if you are borrowing from this file for setting up autotest in your
# project, remember to distribute both testsuite and package.m4.
EXTRA_DIST += \
- $(TESTSUITE_AT) \
tests/local.at \
tests/mktests.sh \
tests/atlocal.in \
## ------------ ##
TESTSUITE_GENERATED_AT = \
- $(srcdir)/tests/aclang.at \
- $(srcdir)/tests/acc.at \
- $(srcdir)/tests/acfortran.at \
- $(srcdir)/tests/acgo.at \
- $(srcdir)/tests/acgeneral.at \
- $(srcdir)/tests/acstatus.at \
- $(srcdir)/tests/acautoheader.at \
- $(srcdir)/tests/acautoupdate.at \
- $(srcdir)/tests/acspecific.at \
- $(srcdir)/tests/acfunctions.at \
- $(srcdir)/tests/acheaders.at \
- $(srcdir)/tests/actypes.at \
- $(srcdir)/tests/aclibs.at \
- $(srcdir)/tests/acprograms.at
+ tests/aclang.at \
+ tests/acc.at \
+ tests/acerlang.at \
+ tests/acfortran.at \
+ tests/acgo.at \
+ tests/acgeneral.at \
+ tests/acstatus.at \
+ tests/acautoheader.at \
+ tests/acautoupdate.at \
+ tests/acspecific.at \
+ tests/acfunctions.at \
+ tests/acheaders.at \
+ tests/actypes.at \
+ tests/aclibs.at \
+ tests/acprograms.at
TESTSUITE_HAND_AT = \
tests/suite.at \
tests/autoscan.at \
tests/foreign.at
+CLEANFILES += $(TESTSUITE_GENERATED_AT)
+EXTRA_DIST += $(TESTSUITE_HAND_AT)
+
TESTSUITE_AT = $(TESTSUITE_GENERATED_AT) $(TESTSUITE_HAND_AT)
TESTSUITE = tests/testsuite
## Producing the test files.
# The files which contain macros we check for syntax. Use $(srcdir)
-# for the benefit of non-GNU make. Fix the names in the rule below
-# where we 'cd' to $srcdir.
+# for the benefit of non-GNU make.
autoconfdir = $(srcdir)/lib/autoconf
AUTOCONF_FILES = $(autoconfdir)/general.m4 \
$(autoconfdir)/status.m4 \
tests/mktests.stamp : tests/mktests.sh $(AUTOCONF_FILES)
@rm -f tests/mktests.tmp
@touch tests/mktests.tmp
- cd $(srcdir) && $(SHELL) tests/mktests.sh \
- `echo " "$(AUTOCONF_FILES) | sed 's, [^ ]*/, lib/autoconf/,g'`
+ $(SHELL) $(srcdir)/tests/mktests.sh $(AUTOCONF_FILES)
@mv -f tests/mktests.tmp $@
-## Distribute the stamp file, since we distribute the generated files.
-EXTRA_DIST += tests/mktests.stamp
-CLEANFILES += tests/mktests.tmp
-MAINTAINERCLEANFILES += tests/mktests.stamp
+CLEANFILES += tests/mktests.tmp tests/mktests.stamp
## maintainer-check ##
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
+# Set locale to C so that `sort' behaves in a uniform way.
+LANGUAGE=C; export LANGUAGE
+LANG=C; export LANG
+LC_ALL=C; export LC_ALL
+
+# Default AWK.
+: ${AWK=awk}
+
# If we fail, clean up, but touch the output files. We probably failed
# because we used some non-portable tool.
# If ever something goes wrong, fail, so that the trap is launched.
set -e
-# We need arguments.
-test $# != 0
-
-# We need these arguments.
-src="$@"
-
-# Set locale to C so that `sort' behaves in a uniform way.
-LANGUAGE=C; export LANGUAGE
-LANG=C; export LANG
-LC_ALL=C export LC_ALL
-
+# We expect a list of autoconf source files as arguments.
+test $# -gt 0
# requires
# --------
# Get the list of macros that are required: there is little interest
# in testing them since they will be run by the guy who requires them.
-sed -n 's/dnl.*//;s/.*AC_REQUIRE(\[*\([a-zA-Z0-9_]*\).*$/\1/p' $src |
+sed -n 's/dnl.*//;s/.*AC_REQUIRE(\[*\([a-zA-Z0-9_]*\).*$/\1/p' "$@" |
sort -u >$requires
## Creating the test files. ##
## ------------------------- ##
-for file in $src
+for file in "$@"
do
base=`echo "$file" | sed 's|.*[\\/]||;s|\..*||'`
acbase=$outdir/ac$base
# Get rid of the macros we are not interested in.
sed -n -e 's/^AC_DEFUN(\[*\([a-zA-Z0-9_]*\).*$/\1/p' \
-e 's/^AC_DEFUN_ONCE(\[*\([a-zA-Z0-9_]*\).*$/\1/p' $file |
- awk "$ac_exclude_script" |
+ $AWK "$ac_exclude_script" |
sort -u >$acdefuns
# Get the list of macros which are defined in Autoupdate level.
sed -n 's/^AU_DEFUN(\[*\([a-zA-Z][a-zA-Z0-9_]*\).*$/\1/p' $file |
- awk "$au_exclude_script" |
+ $AWK "$au_exclude_script" |
sort -u >$audefuns
# Filter out required macros.