]> git.saurik.com Git - bison.git/commitdiff
tests: factor test for printer/desctructor redefined
authorAkim Demaille <akim@lrde.epita.fr>
Mon, 22 Apr 2013 11:47:50 +0000 (13:47 +0200)
committerAkim Demaille <akim@lrde.epita.fr>
Mon, 22 Apr 2013 11:47:50 +0000 (13:47 +0200)
* tests/input.at (Default %printer and %destructor redeclared):
Introduce AT_TEST to factor.

tests/input.at

index 86a38d03af73316f8b4a37885ceb34573aee1d6e..823965883b7cae9c25b9b512920cacb77d6e66d8 100644 (file)
@@ -336,104 +336,67 @@ AT_CLEANUP
 
 AT_SETUP([Default %printer and %destructor redeclared])
 
-AT_DATA([[input.y]],
-[[%destructor { destroy ($$); } <*> <*>
-%printer { print ($$); } <*> <*>
-
-%destructor { destroy ($$); } <*>
-%printer { print ($$); } <*>
-
-%destructor { destroy ($$); } <> <>
-%printer { print ($$); } <> <>
+# AT_TEST([*])
+# ------------
+m4_pushdef([AT_TEST],
+[AT_DATA([[input.y]],
+[[%destructor { destroy ($$); } <$1> <$1>
+%printer { print ($$); } <$1> <$1>
 
-%destructor { destroy ($$); } <>
-%printer { print ($$); } <>
+%destructor { destroy ($$); } <$1>
+%printer { print ($$); } <$1>
 
 %%
 
 start: %empty;
 
-%destructor { destroy ($$); } <*>;
-%printer { print ($$); } <*>;
-
-%destructor { destroy ($$); } <>;
-%printer { print ($$); } <>;
+%destructor { destroy ($$); } <$1>;
+%printer { print ($$); } <$1>;
 ]])
 
 AT_BISON_CHECK([-fcaret input.y], [1], [],
-[[input.y:1.13-29: error: %destructor redeclaration for <*>
- %destructor { destroy ($$); } <*> <*>
-             ^^^^^^^^^^^^^^^^^
-input.y:1.13-29:     previous declaration
- %destructor { destroy ($$); } <*> <*>
-             ^^^^^^^^^^^^^^^^^
-input.y:2.10-24: error: %printer redeclaration for <*>
- %printer { print ($$); } <*> <*>
-          ^^^^^^^^^^^^^^^
-input.y:2.10-24:     previous declaration
- %printer { print ($$); } <*> <*>
-          ^^^^^^^^^^^^^^^
-input.y:4.13-29: error: %destructor redeclaration for <*>
- %destructor { destroy ($$); } <*>
-             ^^^^^^^^^^^^^^^^^
-input.y:1.13-29:     previous declaration
- %destructor { destroy ($$); } <*> <*>
-             ^^^^^^^^^^^^^^^^^
-input.y:5.10-24: error: %printer redeclaration for <*>
- %printer { print ($$); } <*>
-          ^^^^^^^^^^^^^^^
-input.y:2.10-24:     previous declaration
- %printer { print ($$); } <*> <*>
-          ^^^^^^^^^^^^^^^
-input.y:7.13-29: error: %destructor redeclaration for <>
+[[input.y:1.13-29: error: %destructor redeclaration for <>
  %destructor { destroy ($$); } <> <>
              ^^^^^^^^^^^^^^^^^
-input.y:7.13-29:     previous declaration
+input.y:1.13-29:     previous declaration
  %destructor { destroy ($$); } <> <>
              ^^^^^^^^^^^^^^^^^
-input.y:8.10-24: error: %printer redeclaration for <>
+input.y:2.10-24: error: %printer redeclaration for <>
  %printer { print ($$); } <> <>
           ^^^^^^^^^^^^^^^
-input.y:8.10-24:     previous declaration
+input.y:2.10-24:     previous declaration
  %printer { print ($$); } <> <>
           ^^^^^^^^^^^^^^^
-input.y:10.13-29: error: %destructor redeclaration for <>
+input.y:4.13-29: error: %destructor redeclaration for <>
  %destructor { destroy ($$); } <>
              ^^^^^^^^^^^^^^^^^
-input.y:7.13-29:      previous declaration
+input.y:1.13-29:     previous declaration
  %destructor { destroy ($$); } <> <>
              ^^^^^^^^^^^^^^^^^
-input.y:11.10-24: error: %printer redeclaration for <>
+input.y:5.10-24: error: %printer redeclaration for <>
  %printer { print ($$); } <>
           ^^^^^^^^^^^^^^^
-input.y:8.10-24:      previous declaration
+input.y:2.10-24:     previous declaration
  %printer { print ($$); } <> <>
           ^^^^^^^^^^^^^^^
-input.y:17.13-29: error: %destructor redeclaration for <*>
- %destructor { destroy ($$); } <*>;
-             ^^^^^^^^^^^^^^^^^
-input.y:4.13-29:      previous declaration
- %destructor { destroy ($$); } <*>
-             ^^^^^^^^^^^^^^^^^
-input.y:18.10-24: error: %printer redeclaration for <*>
- %printer { print ($$); } <*>;
-          ^^^^^^^^^^^^^^^
-input.y:5.10-24:      previous declaration
- %printer { print ($$); } <*>
-          ^^^^^^^^^^^^^^^
-input.y:20.13-29: error: %destructor redeclaration for <>
+input.y:11.13-29: error: %destructor redeclaration for <>
  %destructor { destroy ($$); } <>;
              ^^^^^^^^^^^^^^^^^
-input.y:10.13-29:     previous declaration
+input.y:4.13-29:      previous declaration
  %destructor { destroy ($$); } <>
              ^^^^^^^^^^^^^^^^^
-input.y:21.10-24: error: %printer redeclaration for <>
+input.y:12.10-24: error: %printer redeclaration for <>
  %printer { print ($$); } <>;
           ^^^^^^^^^^^^^^^
-input.y:11.10-24:     previous declaration
+input.y:5.10-24:      previous declaration
  %printer { print ($$); } <>
           ^^^^^^^^^^^^^^^
 ]])
+])
+
+AT_TEST([], [], [])
+AT_TEST([], [*], [*])
+m4_popdef([AT_TEST])
 
 AT_CLEANUP