Commit Graph

722 Commits

Author SHA1 Message Date
Akim Demaille
1aa9fa823b tests: be sure that backups are safe.
* tests/local.at (at_save_special_files): here.
2012-07-17 14:47:35 +02:00
Akim Demaille
e4828e2384 tests: refactor for legibility.
* tests/local.at (AT_BISON_CHECK_WARNINGS, AT_BISON_CHECK_WARNINGS_):
New.
2012-07-17 14:47:34 +02:00
Akim Demaille
a122efad8a tests: refactor the bison invocations.
* tests/local.at (m4_null_if, AT_BISON_CHECK_): New.
2012-07-17 14:47:34 +02:00
Akim Demaille
916f26b65a tests: fix SKIP_IF for Java.
* tests/local.at (AT_JAVA_COMPILE): here.
2012-07-05 14:27:09 +02:00
Akim Demaille
32ae07efde api.prefix: incompatible with %name-prefix.
* data/bison.m4: Make it incompatible.
* tests/input.at: Check that it is.
2012-07-05 12:41:16 +02:00
Akim Demaille
ad60e80f3d api.prefix: strengthen the tests and fix push-parsers.
* tests/calc.at: Check api.prefix in addition to %name-prefix.
* tests/headers.at: Check push parsers and pure interface.
* tests/local.at: Use YYLTYPE renamed.
* data/yacc.c (b4_declare_yyparse_push_): Handle api.prefix.
* doc/bison.texi: Style changes.
2012-07-05 12:41:15 +02:00
Akim Demaille
faff3bef5b tests: headers.at: strengthen.
* tests/headers.at (Several headers): Be stricter when checking
the exported macros.
2012-07-04 12:24:13 +02:00
Akim Demaille
53ab797db7 glr.cc: do not override C++ definitions by C macros.
* data/glr.c: here.
* data/glr.cc: Fix overquotation.
* tests/headers.at: Comment changes.
2012-07-04 12:24:13 +02:00
Akim Demaille
1168b32295 tests: portability fixes.
Reported by Hydra.

* tests/headers.at (Several headers): Be sure to include config.h
in the files to compile.
2012-07-04 12:24:13 +02:00
Akim Demaille
b142cfd128 tests: more logs.
* tests/headers.at (Several parsers): Here.
2012-07-04 12:24:13 +02:00
Akim Demaille
4b3847c3c0 api.prefix.
* data/c.m4 (b4_api_prefix, b4_api_PREFIX): New.
(b4_prefix, b4_union_name, b4_token_enums, b4_declare_yylstype): Use them.
* data/glr.c, data/yacc.c, data/glr.cc, data/lalr1.cc: Use them to change
the prefix of exported preprocessor symbols.
* src/getargs.c (usage): Ditto.
* tests/headers.at (Several parsers): New.
* tests/local.at (AT_API_PREFIX): New.
AT_YYSTYPE, AT_YYLTYPE): Adjust.
* doc/bison.texi (Multiple Parsers): Move documentation of %name-prefix to...
(Table of Symbols): here.
(Multiple Parsers): Document api.prefix.
(%define Summary): Point to it.
Use @code for variable names.
(Bison Options): -p/--name-prefix are obsoleted.
* NEWS: Announce api.prefix.
2012-06-29 17:40:42 +02:00
Akim Demaille
087dcd7868 tests: use the generalized default yylex.
* tests/actions.at, tests/glr-regression.at, tests/regression.at: here.
2012-06-28 15:01:36 +02:00
Akim Demaille
95361618de tests: AT_YYERROR_DEFINE: prepare for list of ints.
* tests/local.at (AT_YYERROR_DEFINE): Don't add quotes, check their
presence to detect char/int types.
* tests/actions.at, tests/conflicts.at, tests/glr-regression.at,
* tests/push.at, tests/regression.at: Adjust.
2012-06-28 15:01:36 +02:00
Akim Demaille
a32a2d57a5 tests: do not output m4 set up.
* tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
Use a diversion to avoid outputting comments etc.
Removes 17k lines from testsuite (10% of the number of lines).
2012-06-26 14:07:34 +02:00
Akim Demaille
8d6c1b5e85 tests: use the generic yyerror function.
* tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Factor.
Use AT_YYERROR_DEFINE.
Therefore, instead of using stdout, use and check stderr.
* tests/glr-regression.at (Uninitialized location when reporting ambiguity):
Use AT_YYERROR_DEFINE.
2012-06-26 13:55:50 +02:00
Akim Demaille
77519a7d18 tests: use assert instead of plain abort.
* tests/actions.at, tests/calc.at, tests/conflicts.at,
* tests/cxx-type.at, tests/glr-regression.at, tests/input.at,
* tests/named-refs.at, tests/regression.at, tests/torture.at,
* tests/local.at:
Prefer assert to abort.
2012-06-26 13:55:50 +02:00
Akim Demaille
0e16927b48 tests: improve the generic yylex implementation.
* tests/local.at (AT_YYSTYPE, AT_YYLTYPE): New.
(AT_YYLEX_FORMALS): Use them.
(AT_YYLEX_DEFINE): Be independent of the location implementation.
2012-06-26 13:55:49 +02:00
Akim Demaille
91ce0b3a66 tests: generalize the compilation macros.
* tests/local.at (AT_COMPILE, AT_COMPILE_CXX): If OUTPUT ends with ".o",
then append the "natural" extension for the input file (.c or .cc).
If there is no source, pass -c.
* tests/headers.at, tests/input.at, tests/regression.at: Adjust.
2012-06-26 13:55:49 +02:00
Akim Demaille
837b769659 tests: fix confusion between api.prefix and name-prefix.
* tests/local.at (AT_NAME_PREFIX): Take api.prefix into account.
(AT_API_PREFIX): Rename as...
(AT_API_prefix): this.
Do not take %name-prefix into account.
Fix misuses.
2012-06-26 13:55:49 +02:00
Akim Demaille
230a3db428 tests: more uniformity.
* tests/local.at (AT_LEX_FORMALS, AT_LEX_ARGS, AT_LEX_PRE_FORMALS)
(AT_LEX_PRE_ARGS): Rename as...
(AT_YYLEX_FORMALS, AT_YYLEX_ARGS, AT_YYLEX_PRE_FORMALS)
(AT_YYLEX_PRE_ARGS): these, for consistency.
(AT_API_PREFIX): Take %name-prefix into account.
(AT_YYLEX_PROTOTYPE): New.
Use it.
* tests/actions.at, tests/calc.at, tests/cxx-type.at: Adjust to
use them.
2012-06-22 12:08:02 +02:00
Akim Demaille
6d55954743 tests: handle locations in a more generic way.
* tests/local.at (AT_YYERROR_PROTOTYPE): New.
Use it.
* tests/cxx-type.at: Extensive revamp to use a more traditional
quotation scheme, and to use the generic yyerror implementation.
Prefer Autotest macros to CPP macros.
* tests/java.at: .
2012-06-22 11:34:37 +02:00
Akim Demaille
7490994123 tests: handle locations in the generic yyerror functions.
* tests/local.at (AT_YYERROR_DECLARE_EXTERN, AT_YYERROR_DECLARE)
(AT_YYERROR_DEFINE): Handle locations for C and C++.
* tests/calc.at: Use it for C++ (as C has extra arguments which
are not yet handled by AT_BISON_OPTION_PUSHDEFS).
* tests/actions.at: Adjust.
2012-06-22 10:20:28 +02:00
Akim Demaille
eb46d61f4d tests: fix AT_CHECK_CALC.
* tests/calc.at (AT_CHECK_CALC): Contrary to its documentation,
the test was skipped if given a second argument.
Unused feature, remove it.
2012-06-22 09:41:36 +02:00
Akim Demaille
05a7b6ec80 tests: improve infrastructure
* tests/local.at (AT_LANG): Use c++ instead of cxx for C++.
Adjust dependencies.
(AT_YYERROR_DECLARE_EXTERN, AT_YYERROR_DECLARE): Issue nothing
for C++/Java.
(AT_YYERROR_DEFINE): Use m4_case.
(AT_JAVA_COMPILE): Use AT_SKIP_IF.
2012-06-22 09:30:07 +02:00
Akim Demaille
290a8ff2c0 tests: factor.
* tests/glr-regression.at, tests/output.at, tests/push.at,
* tests/regression.at, tests/torture.at, tests/actions.at:
Use AT_YYLEX_* and AT_YYERROR_*.
2012-06-21 22:54:40 +02:00
Akim Demaille
2d40532bf5 tests: AT_LANG.
* tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
Define/undefine AT_LANGE
(AT_LANG_COMPILE): New.
(AT_FULL_COMPILE): Use AT_LANG.
2012-06-21 17:08:11 +02:00
Akim Demaille
71c7e24f2e tests: support api.prefix.
* tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
Define AT_API_PREFIX.
(AT_YYERROR_DEFINE, AT_YYERROR_DECLARE_EXTERN, AT_YYLEX_DECLARE_EXTERN)
(AT_YYLEX_DEFINE): Use it.
* tests/input.at, tests/regression.at, tests/torture.at: Add
AT_BISON_OPTION_PUSHDEFS/POPDEFS.
2012-06-17 19:37:07 +02:00
Akim Demaille
5f7f1e210b tests: pacify font-lock-mode.
* tests/local.at: here.
2012-06-17 19:37:07 +02:00
Akim Demaille
eb83259dc1 tests: remove test covered elsewhere.
* tests/headers.at (%union and --defines): Remove, pretty useless and
insignificant.
2012-06-17 19:37:07 +02:00
Akim Demaille
55f48c4831 tests: factor the declaration/definition of yyerror and yylex.
* tests/local.at (AT_YYERROR_DECLARE, AT_YYERROR_DECLARE_EXTERN)
(AT_YYERROR_DEFINE, AT_YYLEX_DECLARE, AT_YYLEX_DECLARE_EXTERN)
(AT_YYLEX_DEFINE): New.
Must be used inside AT_BISON_OPTION_PUSHDEFS/POPDEFS pair.
* tests/actions.at, tests/conflicts.at, tests/glr-regression.at,
* tests/headers.at, tests/input.at, tests/named-refs.at,
* tests/regression.at, tests/skeletons.at, tests/synclines.at,
* tests/torture.at: Use them.
2012-06-17 19:37:07 +02:00
Akim Demaille
363bf73276 tests: portability issues.
* tests/calc.at (AT_CALC_MAIN): Missing include reported by Hydra.
2012-06-17 11:20:21 +02:00
Akim Demaille
c8c220d19a tests: call the parser from another compilation unit.
In order to improve the testing of %defines, which exports the
interface of the generated parser, change the calc.at tests so that
when %defines is passed, main will be in another compilation unit.  It
loads the generated header.

* tests/calc.at (AT_CALC_MAIN): New.
Includes the definition of the global variables.
Therefore, now declare them from the %requires section of the parser.
Adjust to yydebug and yyparse being renamed by %name-prefix.
2012-06-15 15:39:19 +02:00
Akim Demaille
6aef2e01a4 tests: improve AT_FULL_COMPILE.
* tests/local.at: Accept a third argument.
Simplify quotation pattern.
Calls for better refactoring, but will suffice for a while.
2012-06-15 15:20:53 +02:00
Akim Demaille
3d8082ad27 tests: reorder.
* tests/calc.at (power): Move its definition, as a preparation for
forthcoming changes.
And space changes.
2012-06-15 13:36:01 +02:00
Akim Demaille
9d67a52ad6 tests: strengthen the test on generated headers inclusion
* tests/headers.at (AT_TEST_CPP_GUARD_H): Accept Bison directives.
(Invalid CPP headers): Check glr.
2012-06-15 13:31:59 +02:00
Akim Demaille
02287ec650 tests: remove all the -On flags.
* tests/atlocal.in: Here.
Reported by Gilles Espinasse.
2012-06-12 14:49:48 +02:00
Jim Meyering
cbdb6d9145 maint: fix comment typos
Using http://github.com/lyda/misspell-check, massage its
output into sed commands to perform the suggested changes.
Initially, I filtered out the THRU->Through changes, because
that failed to retain capitalization in the grammar token.
Instead, do this manually, beforehand:

sed -i s/THRU/THROUGH/ tests/existing.at
git ls-files|misspellings -f -|perl -nl \
  -e '/^(.*?)\[(\d+)\]: (\w+) -> "(.*?)"$/ or next;' \
  -e '($file,$n,$l,$r)=($1,$2,$3,$4); $q="'\''"; $r=~s/$q/$q\\$q$q/g;'\
  -e 'print "sed -i $q${n}s!$l!$r!$q $file"'|bash
2012-06-05 09:17:43 +02:00
Akim Demaille
035810ed2e tests: save/restore Autotest special files when checking XML support.
Currently the test 248, "parse-gram.y: LALR = IELR", fails
BISON_TEST_XML is set.

* tests/local.at (AT_BISON_CHECK_XML): Belt: Save/restore files.
* tests/regression.at (parse-gram.y: LALR = IELR): Suspenders: Don't
rely on expout.
Each one of these changes suffices.
2012-05-11 17:13:48 +02:00
Akim Demaille
5192fd5d50 tests: AT_SAVE_SPECIAL_FILES / AT_RESTORE_SPECIAL_FILES.
Some of our macros play with expout and other Autotest special files,
which may break their callers (e.g., currently TESTSUITEFLAGS='248
BISON_TEST_XML=1' fails).

There is already some support for this.  Expand it to be ready to use
it elsewhere.

* tests/local.at (AT_RESTORE_SPECIAL_FILES, AT_SAVE_SPECIAL_FILES)
(at_save_special_files, at_restore_special_files): New.
(AT_BISON_CHECK_NO_XML): Use them.
2012-05-11 17:06:18 +02:00
Akim Demaille
7f7fdba418 tests: honor TESTSUITEFLAGS in all the check targets.
* tests/Makefile.am (installcheck-local): Simplify.
(maintainer-check-posix, maintainer-check-valgrind): Honor
$(TESTSUITEFLAGS).
2012-05-11 15:06:58 +02:00
Akim Demaille
08ab0101bd build: move silent rules.
* tests/Makefile.am: In the generation of the test suite.
2012-05-09 10:44:24 +02:00
Akim Demaille
a0cd287e64 maint: maintainer-release-check.
* tests/Makefile.am (maintainer-release-check): New.
* Makefile.am (MAINTAINER_CHECKS): New.
Support maintainer-release-check.
* README-hacking: Document it, and syntax-check too.
2012-05-08 12:07:29 +02:00
Akim Demaille
db0054f7e6 maint: fix the generation of the synclines for bison's parser.
* tests/bison.in: Import from master the changes that make
this script generate synclines that are independant of the
builddir/srcdir user's set up.
2012-05-06 10:38:29 +02:00
Akim Demaille
95e343fea3 tests: ignore code coverage/profiling failure messages
The Hydra buildfarm provides code coverage analysis.  For some reason,
in some test cases, code coverage data seem to be incompatible, and
generate error messages at parser run-time.  Ignore these messages so
that (i) these tests do pass, (ii) coverage results be provided by
Hydra.

* tests/local.at (AT_PARSER_CHECK): Ignore messages for failed merges
of code coverage/profiling results.
2012-05-02 17:32:53 +02:00
Akim Demaille
a703b669b4 tests: style changes.
* tests/input.at: Use "print" in %printer instead of "destroy".
It is unused, so we don't care, yet it is less surprising.
* tests/actions.at: Comment changes.

(cherry picked from commit abcd36ca1b)
2012-04-16 17:18:31 +02:00
Akim Demaille
6557bcce8b c++: more YY_NULL
Caught by maintainer-check-g++.
* data/glr.c, data/lalr1.cc, data/yacc.c, tests/cxx-type.at,
* tests/glr-regression.at, tests/push.at:
When simple to do, avoid expliciting the null ptr.
Otherwise use YY_NULL.
(cherry picked from commit eeaf1dc646)

Conflicts:

	data/glr.c
	data/lalr1.cc
	tests/cxx-type.at
2012-04-01 14:02:27 +02:00
Akim Demaille
ef51bfa744 c++: use nullptr for C++11.
C++11 introduces "nullptr" which plays the role of C's NULL, in
replacement of "0".  Fix the C++ skeletons to avoid warnings about
uses of "0" in place of "nullptr", and improve C skeletons to also use
this "nullptr" when compiled with a C++11 compiler.

* configure.ac: More C++ warnings.
* NEWS (2.5.1): Document this.
* data/c++.m4, data/c.m4 (b4_null_define): New.
(b4_null): Use YY_NULL instead of 0.
* data/glr.c, data/lalr1.cc, data/location.cc, data/yacc.c:
Call b4_null_define/b4_null where appropriate.
Use YY_NULL instead of NULL.
* data/location.cc (initialize): Accept a default argument,
YY_NULL.
* tests/actions.at, tests/calc.at: Adjust.

* data/glr.c, lib/libiberty.h, src/system.h (__attribute__):
Do not disable it when __STRICT_ANSI__ is defined, as, for
instance, it disables the __attribute__((unused)) which
protects us from some compiler warnings.
This was already done elsewhere in Bison, in 2001, see
4a0d893695.
* tests/regression.at: Adjust output.
2012-03-31 11:12:28 +02:00
Akim Demaille
e85056ef5f build: simplify and improve the compiler warnings for tests.
* configure.ac (warn_common, warn_c, warn_cxx): New.
Use them to compute independently the options supported
by the C and C++ compilers.
Don't AC_SUBST the variables passed to gl_WARN_ADD: it
does it for us.
(WARN_CFLAGS_TEST, WARN_CXXFLAGS_TEST): Don't aggregate
$WARN_CFLAGS and $WARN_CXXFLAGS in them now, leave it
to atlocal.in.
(O0CFLAGS, O0CXXFLAGS): Move their definition to...
* tests/atlocal.in: here.
Be more systematic between C and C++.
Reorder to factor between variables.
Propagate all of the variables when --compile-c-with-cxx.
2012-03-30 14:55:57 +02:00
Tim Landscheidt
e34e97bcd7 Java: Fix syntax error handling without error token.
* data/lalr1.java (YYParser::parse): Here.
* tests/java.at: Add test case.
2012-03-27 15:21:28 +02:00
Akim Demaille
bbaf618c3e tests: beware of -pedantic on large #line numbers.
* tests/local.at (AT_TEST_TABLES_AND_PARSE): Don't pass -pedantic
when compiling large canonical-LR parsers.
Reported by Tys Lefering.
http://lists.gnu.org/archive/html/bug-bison/2012-03/msg00025.html
(cherry picked from commit 8ec3110a9e)
2012-03-24 14:38:58 +01:00