* tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
(_AT_CHECK_CALC_ERROR): Likewise.
Factor the `, ' part of verbose error messages.
+2001-09-18 Akim Demaille <akim@epita.fr>
+
+ * tests/Makefile.am (package.m4): New.
+ * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
+ (_AT_CHECK_CALC_ERROR): Likewise.
+ Factor the `, ' part of verbose error messages.
+
2001-09-18 Marc Autret <autret_m@epita.fr>
2001-09-18 Marc Autret <autret_m@epita.fr>
* src/getargs.c (longopts): Declare --defines and --graph as options
with optional arguments.
* src/files.h: Add extern declarations.
* src/getargs.c (longopts): Declare --defines and --graph as options
with optional arguments.
* src/files.h: Add extern declarations.
2001-09-18 Marc Autret <autret_m@epita.fr>
Turn off %{source,header}_extension feature.
2001-09-18 Marc Autret <autret_m@epita.fr>
Turn off %{source,header}_extension feature.
* src/files.c (compute_exts_from_gf): Update.
(compute_exts_from_src): Update.
(output_files): CPP-out useless code.
* src/files.c (compute_exts_from_gf): Update.
(compute_exts_from_src): Update.
(output_files): CPP-out useless code.
AUTOM4TE = autom4te
AUTOTEST = $(AUTOM4TE) --language=autotest
AUTOM4TE = autom4te
AUTOTEST = $(AUTOM4TE) --language=autotest
-$(srcdir)/$(TESTSUITE): $(TESTSUITE_AT)
+$(srcdir)/$(TESTSUITE): package.m4 $(TESTSUITE_AT)
$(AUTOTEST) -I $(srcdir) testsuite.at -o $@.tmp
mv $@.tmp $@
$(AUTOTEST) -I $(srcdir) testsuite.at -o $@.tmp
mv $@.tmp $@
# Run the test suite on the *installed* tree.
installcheck-local:
$(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin
# Run the test suite on the *installed* tree.
installcheck-local:
$(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin
+
+## ------------ ##
+## package.m4. ##
+## ------------ ##
+
+package.m4: $(top_srcdir)/configure.in
+ { \
+ echo '# Signature of the current package.'; \
+ echo 'm4_define([PACKAGE_NAME], [@PACKAGE_NAME@])'; \
+ echo 'm4_define([PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
+ echo 'm4_define([PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
+ echo 'm4_define([PACKAGE_STRING], [@PACKAGE_STRING@])'; \
+ echo 'm4_define([PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
+ } >package.m4
maintainer-clean-generic mostlyclean mostlyclean-generic \
uninstall uninstall-am uninstall-info-am
maintainer-clean-generic mostlyclean mostlyclean-generic \
uninstall uninstall-am uninstall-info-am
-$(srcdir)/$(TESTSUITE): $(TESTSUITE_AT)
+$(srcdir)/$(TESTSUITE): package.m4 $(TESTSUITE_AT)
$(AUTOTEST) -I $(srcdir) testsuite.at -o $@.tmp
mv $@.tmp $@
$(AUTOTEST) -I $(srcdir) testsuite.at -o $@.tmp
mv $@.tmp $@
# Run the test suite on the *installed* tree.
installcheck-local:
$(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin
# Run the test suite on the *installed* tree.
installcheck-local:
$(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin
+
+package.m4: $(top_srcdir)/configure.in
+ { \
+ echo '# Signature of the current package.'; \
+ echo 'm4_define([PACKAGE_NAME], [@PACKAGE_NAME@])'; \
+ echo 'm4_define([PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
+ echo 'm4_define([PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
+ echo 'm4_define([PACKAGE_STRING], [@PACKAGE_STRING@])'; \
+ echo 'm4_define([PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
+ } >package.m4
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
# _AT_CHECK_CALC(BISON-OPTIONS, INPUT)
# ------------------------------------
# Run `calc' on INPUT and expect no STDOUT nor STDERR.
# _AT_CHECK_CALC(BISON-OPTIONS, INPUT)
# ------------------------------------
# Run `calc' on INPUT and expect no STDOUT nor STDERR.
-# If `--debug' is passed to bison, discard all the debugging traces
-# preserving only the `parse errors'. Note that since there should be
-# none, the `grep' will fail with exit status 1.
m4_define([_AT_CHECK_CALC],
[AT_DATA([[input]],
[[$2
]])
m4_define([_AT_CHECK_CALC],
[AT_DATA([[input]],
[[$2
]])
-m4_match([$1], [--debug],
- [AT_CHECK([calc ./input 2>&1 >/dev/null | grep 'parse error' >&2],
- [1], [], [])],
- [AT_CHECK([./calc <input],
- [0], [], [])])dnl
+AT_CHECK([calc input])dnl
])
# _AT_CHECK_CALC_ERROR(BISON-OPTIONS, INPUT,
# [ERROR-LOCATION], [IF-YYERROR-VERBOSE])
# ------------------------------------------------------------
])
# _AT_CHECK_CALC_ERROR(BISON-OPTIONS, INPUT,
# [ERROR-LOCATION], [IF-YYERROR-VERBOSE])
# ------------------------------------------------------------
-# Run `calc' on INPUT, and expect STDERR.
+# Run `calc' on INPUT, and expect a `parse error' message.
+#
+# If BISON-OPTIONS contains `--location', then make sure the ERROR-LOCATION
+# is correctly output on stderr.
+#
+# If BISON-OPTIONS contains `--yyerror-verbose', then make sure the
+# IF-YYERROR-VERBOSE message is properly output after `parse error, '
+# on STDERR.
m4_define([_AT_CHECK_CALC_ERROR],
[AT_DATA([[input]],
[[$2
]])
m4_define([_AT_CHECK_CALC_ERROR],
[AT_DATA([[input]],
[[$2
]])
-AT_CHECK([./calc <input 2>&1 >/dev/null | grep 'parse error' >&2], 0,
+AT_CHECK([calc input], 0,
[],
[m4_match([$1], [--location], [$3: ])[]dnl
parse error[]dnl
[],
[m4_match([$1], [--location], [$3: ])[]dnl
parse error[]dnl
-m4_match([$1], [--yyerror-verbose], [$4])[]dnl
+m4_match([$1], [--yyerror-verbose], [, $4])[]dnl
# Some parse errors.
_AT_CHECK_CALC_ERROR([$1], [+1],
[1.0:1.1],
# Some parse errors.
_AT_CHECK_CALC_ERROR([$1], [+1],
[1.0:1.1],
_AT_CHECK_CALC_ERROR([$1], [1//2],
[1.2:1.3],
_AT_CHECK_CALC_ERROR([$1], [1//2],
[1.2:1.3],
- [, unexpected `'/'', expecting `NUM' or `'-'' or `'(''])
+ [unexpected `'/'', expecting `NUM' or `'-'' or `'(''])
_AT_CHECK_CALC_ERROR([$1], [error],
[1.0:1.1],
_AT_CHECK_CALC_ERROR([$1], [error],
[1.0:1.1],
- [, unexpected `$undefined.'])
+ [unexpected `$undefined.'])
_AT_CHECK_CALC_ERROR([$1], [1 = 2 = 3],
[1.6:1.7],
_AT_CHECK_CALC_ERROR([$1], [1 = 2 = 3],
[1.6:1.7],
_AT_CHECK_CALC_ERROR([$1],
[
+1],
[2.0:2.1],
_AT_CHECK_CALC_ERROR([$1],
[
+1],
[2.0:2.1],
AT_CLEANUP(calc calc.c calc.h calc.output)
])# AT_CHECK_CALC
AT_CLEANUP(calc calc.c calc.h calc.output)
])# AT_CHECK_CALC