]> git.saurik.com Git - bison.git/blobdiff - tests/input.at
build: avoid YACC typo inherited from Autoconf.
[bison.git] / tests / input.at
index 9c5db8d9d8bf4160f7ca2f58c8fa062038572bb3..c8e28be75bacfab25a7aa2a1aa8855460b348d88 100644 (file)
@@ -1034,7 +1034,7 @@ start: ;
 ]])
 AT_BISON_CHECK([[input.y]], [[1]], [[]],
 [[input.y:1.9-29: invalid value for %define variable `lr.default-reductions': `bogus'
-input.y:1.9-29: accepted value: `full'
+input.y:1.9-29: accepted value: `most'
 input.y:1.9-29: accepted value: `consistent'
 input.y:1.9-29: accepted value: `accepting'
 ]])
@@ -1308,3 +1308,36 @@ AT_BISON_CHECK([[-Dparse.lac.memory-trace=full input.y]],
 ]])
 
 AT_CLEANUP
+
+## --------------------------------------------- ##
+## -Werror is not affected by -Wnone and -Wall.  ##
+## --------------------------------------------- ##
+
+AT_SETUP([[-Werror is not affected by -Wnone and -Wall]])
+
+AT_DATA([[input.y]],
+[[%%
+foo-bar: ;
+]])
+
+# -Werror is not enabled by -Wall or equivalent.
+AT_BISON_CHECK([[-Wall input.y]], [[0]], [[]],
+[[input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar
+]])
+AT_BISON_CHECK([[-W input.y]], [[0]], [[]],
+[[input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar
+]])
+AT_BISON_CHECK([[-Wno-none input.y]], [[0]], [[]],
+[[input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar
+]])
+
+# -Werror is not disabled by -Wnone or equivalent.
+AT_BISON_CHECK([[-Werror,none,yacc input.y]], [[1]], [[]], [[stderr]])
+AT_CHECK([[sed 's/^.*bison:/bison:/' stderr]], [[0]],
+[[bison: warnings being treated as errors
+input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar
+]])
+[mv stderr experr]
+AT_BISON_CHECK([[-Werror,no-all,yacc input.y]], [[1]], [[]], [[experr]])
+
+AT_CLEANUP