summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkim Demaille <akim@lrde.epita.fr>2013-04-22 13:47:50 +0200
committerAkim Demaille <akim@lrde.epita.fr>2013-04-22 13:47:50 +0200
commitdfb12d684501e72538f50f9f5355ca4f15931533 (patch)
tree60f2e99b5632fb3e097a2fe00c1dd76677a88496
parentd8ce7031024f463a8ba96fc7b2a75facdc52ecb9 (diff)
downloadbison-dfb12d684501e72538f50f9f5355ca4f15931533.tar.gz
tests: factor test for printer/desctructor redefined
* tests/input.at (Default %printer and %destructor redeclared): Introduce AT_TEST to factor.
-rw-r--r--tests/input.at91
1 files changed, 27 insertions, 64 deletions
diff --git a/tests/input.at b/tests/input.at
index 86a38d03..82396588 100644
--- a/tests/input.at
+++ b/tests/input.at
@@ -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