traces: display the Bison version

* src/main.c (main): When traces are enabled, display the Bison
version.
* tests/conflicts.at, tests/report.at, tests/sets.at:
Use AT_PACKAGE_VERSION (for package.m4) instead of post-processing the
output.
This commit is contained in:
Akim Demaille
2021-01-30 09:43:57 +01:00
parent de93a0728b
commit fc0dbb3bba
5 changed files with 27 additions and 24 deletions

View File

@@ -94,6 +94,9 @@ main (int argc, char *argv[])
getargs (argc, argv);
if (trace_flag)
fprintf (stderr, "bison (GNU Bison) %s\n", VERSION);
timevar_enabled = trace_flag & trace_time;
timevar_init ();
timevar_start (tv_total);

3
tests/.gitignore vendored
View File

@@ -2,9 +2,6 @@
/atconfig
/atlocal
/bison
/calc
/calc.[chy]
/calc.tab.*
/package.m4
/testsuite
/testsuite.dir

View File

@@ -1957,7 +1957,8 @@ empty_c3: %prec 'c' ;
]])
AT_BISON_CHECK([[--trace=cex -fcaret --report=all -o input.c input.y]], 0, [],
[[init: 0.000000
[[bison (GNU Bison) ]AT_PACKAGE_VERSION[
init: 0.000000
# state items: 26
State 0:
0 $accept: . start $end

View File

@@ -578,8 +578,8 @@ State 19
AT_CHECK([sed -e '1s/GNU Bison .*\.$/GNU Bison VERSION./' input.gv], [],
[[// Generated by GNU Bison VERSION.
AT_CHECK([cat input.gv], [],
[[// Generated by GNU Bison ]AT_PACKAGE_VERSION[.
// Report bugs to <bug-bison@gnu.org>.
// Home page: <https://www.gnu.org/software/bison/>.
@@ -672,10 +672,10 @@ digraph "input.yy"
]])
AT_CHECK([[sed -e 's/bison-xml-report version="[^"]*"/bison-xml-report version="VERSION"/g' input.xml]], [],
AT_CHECK([[cat input.xml]], [],
[[<?xml version="1.0"?>
<bison-xml-report version="VERSION" bug-report="bug-bison@gnu.org" url="https://www.gnu.org/software/bison/">
<bison-xml-report version="]AT_PACKAGE_VERSION[" bug-report="bug-bison@gnu.org" url="https://www.gnu.org/software/bison/">
<filename>input.yy</filename>
@@ -1140,7 +1140,7 @@ AT_CHECK([[sed -e 's/bison-xml-report version="[^"]*"/bison-xml-report version="
]])
# Check HTML output.
AT_CHECK([[sed -e 's/GNU Bison [0-9][-.0-9a-z]*/GNU Bison VERSION/g' input.html]], [],
AT_CHECK([[cat input.html]], [],
[[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:bison="https://www.gnu.org/software/bison/">
@@ -1492,7 +1492,7 @@ AT_CHECK([[sed -e 's/GNU Bison [0-9][-.0-9a-z]*/GNU Bison VERSION/g' input.html]
<div id="footer"><hr />This document was generated using
<a href="https://www.gnu.org/software/bison/" title="GNU Bison">
GNU Bison VERSION</a>
GNU Bison ]AT_PACKAGE_VERSION[</a>
XML Automaton Report.<br />
Verbatim copying and distribution of this entire page is
permitted in any medium, provided this notice is preserved.</div></body>
@@ -1902,8 +1902,8 @@ State 27
AT_CHECK([sed -e '1s/GNU Bison .*\.$/GNU Bison VERSION./' input.gv], [],
[[// Generated by GNU Bison VERSION.
AT_CHECK([cat input.gv], [],
[[// Generated by GNU Bison ]AT_PACKAGE_VERSION[.
// Report bugs to <bug-bison@gnu.org>.
// Home page: <https://www.gnu.org/software/bison/>.
@@ -2026,10 +2026,10 @@ digraph "input.yy"
]])
AT_CHECK([[sed -e 's/bison-xml-report version="[^"]*"/bison-xml-report version="VERSION"/g' input.xml]], [],
AT_CHECK([[cat input.xml]], [],
[[<?xml version="1.0"?>
<bison-xml-report version="VERSION" bug-report="bug-bison@gnu.org" url="https://www.gnu.org/software/bison/">
<bison-xml-report version="]AT_PACKAGE_VERSION[" bug-report="bug-bison@gnu.org" url="https://www.gnu.org/software/bison/">
<filename>input.yy</filename>
@@ -2651,7 +2651,7 @@ if test x"$XSLTPROC" != x""; then
AT_CHECK([[$XSLTPROC \
`]]AT_SET_ENV[[ bison --print-datadir`/xslt/xml2xhtml.xsl \
input.xml >input.html]])
AT_CHECK([sed -e 's,GNU Bison .*</a>,GNU Bison VERSION</a>,' input.html], [],
AT_CHECK([cat input.html], [],
[[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:bison="https://www.gnu.org/software/bison/">
@@ -3088,7 +3088,7 @@ if test x"$XSLTPROC" != x""; then
<div id="footer"><hr />This document was generated using
<a href="https://www.gnu.org/software/bison/" title="GNU Bison">
GNU Bison VERSION</a>
GNU Bison ]AT_PACKAGE_VERSION[</a>
XML Automaton Report.<br />
Verbatim copying and distribution of this entire page is
permitted in any medium, provided this notice is preserved.</div></body>
@@ -3429,8 +3429,8 @@ State 8
AT_CHECK([sed -e '1s/GNU Bison .*\.$/GNU Bison VERSION./' input.gv], [],
[[// Generated by GNU Bison VERSION.
AT_CHECK([cat input.gv], [],
[[// Generated by GNU Bison ]AT_PACKAGE_VERSION[.
// Report bugs to <bug-bison@gnu.org>.
// Home page: <https://www.gnu.org/software/bison/>.
@@ -3483,10 +3483,10 @@ digraph "input.y"
]])
AT_CHECK([[sed -e 's/bison-xml-report version="[^"]*"/bison-xml-report version="VERSION"/g' input.xml]], [],
AT_CHECK([[cat input.xml]], [],
[[<?xml version="1.0"?>
<bison-xml-report version="VERSION" bug-report="bug-bison@gnu.org" url="https://www.gnu.org/software/bison/">
<bison-xml-report version="]AT_PACKAGE_VERSION[" bug-report="bug-bison@gnu.org" url="https://www.gnu.org/software/bison/">
<filename>input.y</filename>
@@ -3749,7 +3749,7 @@ AT_CHECK([[sed -e 's/bison-xml-report version="[^"]*"/bison-xml-report version="
]])
AT_CHECK([[sed -e 's/GNU Bison [0-9][-.0-9a-z]*/GNU Bison VERSION/g' input.html]], [],
AT_CHECK([[cat input.html]], [],
[[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:bison="https://www.gnu.org/software/bison/">
@@ -3971,7 +3971,7 @@ AT_CHECK([[sed -e 's/GNU Bison [0-9][-.0-9a-z]*/GNU Bison VERSION/g' input.html]
<div id="footer"><hr />This document was generated using
<a href="https://www.gnu.org/software/bison/" title="GNU Bison">
GNU Bison VERSION</a>
GNU Bison ]AT_PACKAGE_VERSION[</a>
XML Automaton Report.<br />
Verbatim copying and distribution of this entire page is
permitted in any medium, provided this notice is preserved.</div></body>

View File

@@ -323,7 +323,8 @@ fact: "num"
]])
AT_BISON_CHECK([[--trace=grammar -o input.c input.y]], [], [],
[[input.y: warning: 1 nonterminal useless in grammar [-Wother]
[[bison (GNU Bison) ]AT_PACKAGE_VERSION[
input.y: warning: 1 nonterminal useless in grammar [-Wother]
input.y: warning: 1 rule useless in grammar [-Wother]
input.y:4.1-7: warning: nonterminal useless in grammar: useless [-Wother]
Reduced Grammar
@@ -409,7 +410,8 @@ exp:
]])
AT_BISON_CHECK([[--trace=grammar -o input.c input.y]], [], [],
[[Reduced Grammar
[[bison (GNU Bison) ]AT_PACKAGE_VERSION[
Reduced Grammar
ntokens = 10, nnterms = 2, nsyms = 12, nrules = 8, nritems = 29