tests/lex-depend.test


Log

Author Commit Date CI Message
Stefano Lattarini 641a5a4b 2012-02-16T10:46:23 maint: run "make update-copyright"
Stefano Lattarini 0b34421d 2012-02-12T16:37:44 tests: fix spurious failures due to missing 'yywrap()' function The AC_PROG_LEX Autoconf macro does not diagnose a failure to find the "lex library" expected to provide a 'yywrap' function (function which is required to link most lex-generated programs). On the contrary, when all the link attempts (i.e., with '-ll' and '-lfl') fail, configure declares that no lex library is needed, and simply proceeds with the configuration process -- only for the build to possibly fail later, at make time. This behaviour is intended; the Autoconf manual reads: You are encouraged to use Flex in your sources, since it is both more pleasant to use than plain Lex and the C source it produces is portable. In order to ensure portability, however, you must either provide a function 'yywrap' or, if you don't use it (e.g., your scanner has no '#include'-like feature), simply include a '%noyywrap' statement in the scanner's source. This AC_PROG_LEX behaviour is causing some spurious failures of the Automake testsuite in environments which lack a proper library providing 'yywrap' (this happens for example on Fedora-based systems). The proper workaround is to simply provide a fall-back implementation of 'yywrap' in our lexers. See also similar commits 'v1.11-546-gca0ba5d' (24-10-2011), 'v1.11-1085-gb5c3968' (24-10-2011) and 'v1.11-871-geb147a1' (25-05-2011). * tests/lex-clean.test: Provide a dummy 'yywrap' function. * tests/lex-line.test: Likewise. * tests/lex-nodist.test: Likewise. * tests/lex-depend.test: Likewise. * tests/lex-clean-cxx.test: Move the dummy 'yywrap' function from the main '.cc' file into the '.lxx' file, so that it won't be subject to the namespace declaration in the '.cc' file (which was causing a spurious link error in systems without a default "lex library").
Stefano Lattarini b67712ac 2011-05-13T16:09:10 lex tests: make test on Lex dependency tracking more "semantic" * tests/lex4.test: Renamed ... * tests/lex-depend-grep.test: ... to this, and extended. * tests/lex-depend.test, tests/lex-depend-cxx.test: ... these new tests. * tests/Makefile.am (TESTS): Update.