summaryrefslogtreecommitdiff
path: root/tests/javapush.at
diff options
context:
space:
mode:
authorAkim Demaille <akim@lrde.epita.fr>2013-06-21 11:39:02 +0200
committerAkim Demaille <akim@lrde.epita.fr>2013-06-21 11:39:02 +0200
commit58b465ae5f7fb39e025540d02455f580749ccbdb (patch)
treec8524b500c6d99260d2b80937998c1ea99cd94f1 /tests/javapush.at
parentd116722c542af7c6c85012064aa06c0f4d8d3d01 (diff)
downloadbison-58b465ae5f7fb39e025540d02455f580749ccbdb.tar.gz
tests: fix Java push failure when running with BISON_USE_PUSH_FOR_PULL
* tests/javapush.at (Trivial Push Parser with api.push-pull verification): When push for pull is enabled, there is one such function generated.
Diffstat (limited to 'tests/javapush.at')
-rw-r--r--tests/javapush.at21
1 files changed, 18 insertions, 3 deletions
diff --git a/tests/javapush.at b/tests/javapush.at
index f50b666c..306b37d4 100644
--- a/tests/javapush.at
+++ b/tests/javapush.at
@@ -161,21 +161,29 @@ m4_define([AT_TRIVIAL_PARSER_INITIAL_ACTION],[
}
])
+## ----------------------------------------------------- ##
+## Trivial Push Parser with api.push-pull verification. ##
+## ----------------------------------------------------- ##
+
AT_SETUP([Trivial Push Parser with api.push-pull verification])
AT_BISON_OPTION_PUSHDEFS
-AT_DATA([[input.y]],[[%language "Java"
+
+AT_DATA([[input.y]],
+[[%language "Java"
]AT_TRIVIAL_PARSER[
]])
-AT_BISON_OPTION_POPDEFS
# Verify that the proper procedure(s) are generated for each case.
AT_BISON_CHECK([[-Dapi.push-pull=pull -o Main.java input.y]])
AT_CHECK_JAVA_GREP([[Main.java]],
[[.*public boolean parse ().*]],
[1])
+# If BISON_USE_PUSH_FOR_PULL is set, then we have one occurrence of
+# this function, otherwise it should not be there.
AT_CHECK_JAVA_GREP([[Main.java]],
[[.*public int push_parse (int yylextoken, Object yylexval).*]],
- [0])
+ [${BISON_USE_PUSH_FOR_PULL-0}])
+
AT_BISON_CHECK([[-Dapi.push-pull=both -o Main.java input.y]])
AT_CHECK_JAVA_GREP([[Main.java]],
[[.*public boolean parse ().*]],
@@ -183,6 +191,7 @@ AT_CHECK_JAVA_GREP([[Main.java]],
AT_CHECK_JAVA_GREP([[Main.java]],
[[.*public int push_parse (int yylextoken, Object yylexval).*]],
[1])
+
AT_BISON_CHECK([[-Dapi.push-pull=push -o Main.java input.y]])
AT_CHECK_JAVA_GREP([[Main.java]],
[[.*public boolean parse ().*]],
@@ -193,8 +202,14 @@ AT_CHECK_JAVA_GREP([[Main.java]],
AT_JAVA_COMPILE([[Main.java]])
AT_JAVA_PARSER_CHECK([Main], 0, [], [stderr-nolog])
+AT_BISON_OPTION_POPDEFS
AT_CLEANUP
+
+## ------------------------------------------ ##
+## Trivial Push Parser with %initial-action. ##
+## ------------------------------------------ ##
+
AT_SETUP([Trivial Push Parser with %initial-action])
AT_BISON_OPTION_PUSHDEFS
AT_DATA([[input.y]],[[%language "Java"