diff options
-rw-r--r-- | testsuite/runtest.main/abort.exp | 11 | ||||
-rw-r--r-- | testsuite/runtest.main/abort/testsuite/abort.test/abort-dbz.exp | 29 |
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" |