aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-06-19 14:36:58 +0200
committerJacob Bachmeyer <jcb62281+dev@gmail.com>2020-06-19 19:17:27 -0500
commitc3252e33cf41f0d6e4ac6ef8099f925579b1a1ff (patch)
tree6d1319154e9c07604c26335066637f0c95fecfe8
parentf7dea4fbb09dba4129b1621829f534e6507653f7 (diff)
downloaddejagnu-c3252e33cf41f0d6e4ac6ef8099f925579b1a1ff.zip
dejagnu-c3252e33cf41f0d6e4ac6ef8099f925579b1a1ff.tar.gz
dejagnu-c3252e33cf41f0d6e4ac6ef8099f925579b1a1ff.tar.bz2
Add tests for handling arithmetic errors in non-auto-loaded procedures
-rw-r--r--testsuite/runtest.main/abort.exp11
-rw-r--r--testsuite/runtest.main/abort/testsuite/abort.test/abort-dbz.exp29
2 files changed, 40 insertions, 0 deletions
diff --git a/testsuite/runtest.main/abort.exp b/testsuite/runtest.main/abort.exp
index b352b56..59a934c 100644
--- a/testsuite/runtest.main/abort.exp
+++ b/testsuite/runtest.main/abort.exp
@@ -50,6 +50,17 @@ set tests {
"PASS: running abort-undef.exp.*\
*UNRESOLVED: .* aborted.*\
*expected passes\[ \t\]+1\n.*unresolved testcases\[ \t\]+1\n" }
+ { "stop at divide-by-zero without --keep_going"
+ "abort-dbz.exp simple.exp"
+ "PASS: running abort-dbz.exp.*\
+ *UNRESOLVED: .* aborted.*\
+ *expected passes\[ \t\]+1\n.*unresolved testcases\[ \t\]+1\n" }
+ { "continue after divide-by-zero with --keep_going"
+ "--keep_going abort-dbz.exp simple.exp"
+ "PASS: running abort-dbz.exp.*\
+ *UNRESOLVED: .* aborted.*\
+ *PASS: simple test.*\
+ *expected passes\[ \t\]+2\n" }
{ "stop at auto-loaded divide-by-zero without --keep_going"
"abort-al-dbz.exp simple.exp"
"PASS: running abort-al-dbz.exp.*\
diff --git a/testsuite/runtest.main/abort/testsuite/abort.test/abort-dbz.exp b/testsuite/runtest.main/abort/testsuite/abort.test/abort-dbz.exp
new file mode 100644
index 0000000..711347d
--- /dev/null
+++ b/testsuite/runtest.main/abort/testsuite/abort.test/abort-dbz.exp
@@ -0,0 +1,29 @@
+# Copyright (C) 2020 Free Software Foundation, Inc.
+#
+# This file is part of DejaGnu.
+#
+# DejaGnu is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# DejaGnu is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with DejaGnu; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Cause a divide-by-zero error.
+
+pass "running abort-dbz.exp"
+
+proc throw_arith_error_div_by_zero { } {
+ expr { 1 / 0 }
+}
+
+throw_arith_error_div_by_zero
+
+fail "script did not abort"