summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkim Demaille <akim@lrde.epita.fr>2013-10-23 15:04:15 +0200
committerAkim Demaille <akim@lrde.epita.fr>2013-10-24 17:22:21 +0200
commit026816664ff8283a55f91915843a8ff0ac5cf86c (patch)
tree78185e164e3dd0c2aeaa9e7a5a0195bbc0751893
parent265640d56ed2eece90efd92f21fc9e614e575724 (diff)
downloadbison-026816664ff8283a55f91915843a8ff0ac5cf86c.tar.gz
tests: skip C++ tests that are too demanding for some compilers
Some tests now fail when compiled with G++ 4.3 or 4.4 on MacPorts. * tests/local.at (AT_SKIP_IF_EXCEPTION_SUPPORT_IS_POOR): New. * tests/c++.at (Exception safety): Use it.
-rw-r--r--tests/c++.at2
-rw-r--r--tests/local.at43
2 files changed, 45 insertions, 0 deletions
diff --git a/tests/c++.at b/tests/c++.at
index 39c13f82..ac68dc0c 100644
--- a/tests/c++.at
+++ b/tests/c++.at
@@ -655,6 +655,8 @@ AT_CLEANUP
m4_pushdef([AT_TEST],
[AT_SETUP([[Exception safety $1]])
+AT_SKIP_IF_EXCEPTION_SUPPORT_IS_POOR
+
AT_BISON_OPTION_PUSHDEFS([%skeleton "lalr1.cc" $1])
AT_DATA_GRAMMAR([[input.yy]],
diff --git a/tests/local.at b/tests/local.at
index ee00e009..72c0d529 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -875,6 +875,49 @@ AT_PARSER_CHECK([./c-and-cxx])
])
+# AT_SKIP_IF_EXCEPTION_SUPPORT_IS_POOR
+# ------------------------------------
+# Check that we can expect exceptions to be handled properly.
+# GCC 4.3 and 4.4 fail https://trac.macports.org/ticket/40853.
+m4_define([AT_SKIP_IF_EXCEPTION_SUPPORT_IS_POOR],
+[AT_DATA_SOURCE([exception.cc],
+[[#include <iostream>
+#include <stdexcept>
+
+void foo()
+{
+ try
+ {
+ throw std::runtime_error("foo");
+ }
+ catch (...)
+ {
+ std::cerr << "Inner caught" << std::endl;
+ throw;
+ }
+}
+
+int main()
+{
+ try
+ {
+ foo();
+ }
+ catch (...)
+ {
+ std::cerr << "Outer caught" << std::endl;
+ return 0;
+ }
+ return 1;
+}
+]])
+AT_COMPILE_CXX([exception])
+# The "empty" quadrigraph is to protect from cfg.mk's
+# sc_at_parser_check.
+AT_CHECK([@&t@./exception || exit 77], [0], [], [ignore])
+])
+
+
## ---------------------------- ##
## Running a generated parser. ##
## ---------------------------- ##