diff options
-rw-r--r-- | ChangeLog | 31 | ||||
-rw-r--r-- | Makefile.am | 10 | ||||
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | doc/dejagnu.texi | 8 | ||||
-rw-r--r-- | doc/runtest.1 | 6 | ||||
-rw-r--r-- | runtest.exp | 18 | ||||
-rw-r--r-- | testsuite/runtest.main/abort.exp | 101 | ||||
-rw-r--r-- | testsuite/runtest.main/error.exp | 81 | ||||
-rw-r--r-- | testsuite/runtest.main/error/testsuite/error.test/error-al-dbz.exp (renamed from testsuite/runtest.main/abort/testsuite/abort.test/abort-al-dbz.exp) | 2 | ||||
-rw-r--r-- | testsuite/runtest.main/error/testsuite/error.test/error-dbz.exp (renamed from testsuite/runtest.main/abort/testsuite/abort.test/abort-dbz.exp) | 2 | ||||
-rw-r--r-- | testsuite/runtest.main/error/testsuite/error.test/error-undef.exp (renamed from testsuite/runtest.main/abort/testsuite/abort.test/abort-undef.exp) | 2 | ||||
-rw-r--r-- | testsuite/runtest.main/error/testsuite/error.test/simple.exp (renamed from testsuite/runtest.main/abort/testsuite/abort.test/simple.exp) | 0 |
13 files changed, 121 insertions, 148 deletions
@@ -2,10 +2,39 @@ PR 41824 / PR 41918 + * NEWS: Remove items for --keep_going / --no_keep_going options. + + * Makefile.am (CLEANFILES): Adjust for renames. + (TESTSUITE_FILES): Likewise. + + * doc/dejagnu.texi (Invoking runtest): Remove --keep_going and + --no_keep_going options. + * doc/runtest.1: Likewise. + * lib/framework.exp (log_and_exit): Print collected Tcl errors. - * runtest.exp (dejagnu::error): New namespace. + * runtest.exp (dejagnu::error): New internal namespace. (runtest): Collect Tcl errors caught while executing test scripts. + (dejagnu::opt): Remove internal namespace. + Remove --keep_going / --no_keep_going options. No longer abort on + any Tcl errors; instead store them and repeat the messages at the + end of the run. + + * testsuite/runtest.main/abort.exp: Rename from this ... + * testsuite/runtest.main/error.exp: ... to this and revise tests. + + * testsuite/runtest.main/abort/testsuite/abort.test/abort-al-dbz.exp: + Rename from this... + * testsuite/runtest.main/error/testsuite/error.test/error-al-dbz.exp: + ... to this. + * testsuite/runtest.main/abort/testsuite/abort.test/abort-dbz.exp: + Rename from this... + * testsuite/runtest.main/error/testsuite/error.test/error-dbz.exp: + ... to this. + * testsuite/runtest.main/abort/testsuite/abort.test/abort-undef.exp: + Rename from this... + * testsuite/runtest.main/error/testsuite/error.test/error-undef.exp: + ... to this. 2020-06-24 Jacob Bachmeyer <jcb62281+dev@gmail.com> diff --git a/Makefile.am b/Makefile.am index 766125d..03bbdc9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,7 +26,7 @@ EXTRA_DIST = ChangeLog-1992 MAINTAINERS dejagnu runtest \ $(commands_DATA) $(TESTSUITE_FILES) $(TEXINFO_TEX)\ $(CONTRIB) -CLEANFILES = abort-init.exp options-init.exp stats-init.exp +CLEANFILES = error-init.exp options-init.exp stats-init.exp clean-local: clean-local-check .PHONY: clean-local-check @@ -180,9 +180,11 @@ TESTSUITE_FILES = \ testsuite/runtest.libs/remote.test \ testsuite/runtest.libs/target.test \ testsuite/runtest.libs/utils.test \ - testsuite/runtest.main/abort.exp \ - testsuite/runtest.main/abort/testsuite/abort.test/abort-undef.exp \ - testsuite/runtest.main/abort/testsuite/abort.test/simple.exp \ + testsuite/runtest.main/error.exp \ + testsuite/runtest.main/error/testsuite/error.test/error-al-dbz.exp \ + testsuite/runtest.main/error/testsuite/error.test/error-dbz.exp \ + testsuite/runtest.main/error/testsuite/error.test/error-undef.exp \ + testsuite/runtest.main/error/testsuite/error.test/simple.exp \ testsuite/runtest.main/options.exp \ testsuite/runtest.main/options/testsuite/null.test/null.exp \ testsuite/runtest.main/stats.exp \ diff --git a/Makefile.in b/Makefile.in index bc9d1e5..bebc03d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -381,7 +381,7 @@ EXTRA_DIST = ChangeLog-1992 MAINTAINERS dejagnu runtest \ $(commands_DATA) $(TESTSUITE_FILES) $(TEXINFO_TEX)\ $(CONTRIB) -CLEANFILES = abort-init.exp options-init.exp stats-init.exp +CLEANFILES = error-init.exp options-init.exp stats-init.exp bin_SCRIPTS = dejagnu runtest include_HEADERS = dejagnu.h pkgdata_DATA = \ @@ -11,12 +11,6 @@ X. runtest now responds consistently to all Tcl errors and generates an UNRESOLVED result when a test script aborts. Previously, calling an undefined procedure would cause the test run to abort while other Tcl errors produced only an easily-ignored message. -X. runtest now accepts a --keep_going option to continue with other test - scripts after a test script fails with a Tcl error. If you have - automated systems that run tests and need to carry on after Tcl errors, - now is the time to add this option to your configuration. -X. runtest now accepts a --no_keep_going option to stop immediately when a - test script aborts. This is planned to become the default in 1.7. 3. A utility procedure relative_filename has been added. This procedure computes a relative file name to a given destination from a given base. 4. The utility procedure 'grep' now accepts a '-n' option that diff --git a/doc/dejagnu.texi b/doc/dejagnu.texi index 49653ea..bb386e8 100644 --- a/doc/dejagnu.texi +++ b/doc/dejagnu.texi @@ -644,14 +644,6 @@ The host board to use. @item @code{--ignore [tests(s)] } The name(s) of specific tests to ignore. -@item @code{--keep_going} -Continue testing when test scripts encounter recoverable fatal errors. -Such errors always cause the offending test script to abort -immediately, but DejaGnu may be able to continue with the next script. - -@item @code{--no_keep_going} -Stop testing immediately when test scripts encounter fatal errors. - @item @code{--local_init [name]} Use @emph{name} as the testsuite local init file instead of @file{site.exp} in the current directory and in @emph{objdir}. The diff --git a/doc/runtest.1 b/doc/runtest.1 index ae04b6f..d48f992 100644 --- a/doc/runtest.1 +++ b/doc/runtest.1 @@ -45,12 +45,6 @@ The host board definition to use. .BI --ignore \ test1.exp\ test2.exp\ ... Do not run the specified tests. .TP -.B --keep_going -Do not abort test run if a test script encounters a fatal error. -.TP -.B --no_keep_going -Stop immediately if a test script encounters a fatal error. -.TP .BI --local_init \ NAME The NAME to use for the testsuite local init file in both the current directory and objdir. diff --git a/runtest.exp b/runtest.exp index 83c4140..21adcf6 100644 --- a/runtest.exp +++ b/runtest.exp @@ -98,13 +98,6 @@ set testsuitedir "testsuite" ;# top-level testsuite source directory set testbuilddir "testsuite" ;# top-level testsuite object directory # -# These are used for internal command-line flags. -# -namespace eval ::dejagnu::opt { - variable keep_going 1 ;# continue after a fatal error in testcase? -} - -# # Collected errors # namespace eval ::dejagnu::error { @@ -387,8 +380,6 @@ proc usage { } { send_user "\t--host \[triplet\]\tThe canonical triplet of the host machine\n" send_user "\t--host_board \[name\]\tThe host board to use\n" send_user "\t--ignore \[name(s)\]\tThe names of specific tests to ignore\n" - send_user "\t--keep_going\t\tContinue testing even if a script aborts\n" - send_user "\t--no_keep_going\t\tStop immediately if a script aborts\n" send_user "\t--local_init \[name\]\tThe file to load for local configuration\n" send_user "\t--log_dialog\t\t\Emit Expect output on stdout\n" send_user "\t--mail \[name(s)\]\tWhom to mail the results to\n" @@ -1216,14 +1207,6 @@ for { set i 0 } { $i < $argc } { incr i } { continue } - "--k*" { # (--keep_going) reduce fatal errors - set ::dejagnu::opt::keep_going 1 - } - - "--no[-_]k*" { # (--no_keep_going) stop on error - set ::dejagnu::opt::keep_going 0 - } - "--m*" { # (--mail) mail the output set mailing_list $optarg set mail_logs 1 @@ -1624,7 +1607,6 @@ proc runtest { test_file_name } { } lappend ::dejagnu::error::list $new_error unresolved "testcase '$test_file_name' aborted due to Tcl error" - if { ! $::dejagnu::opt::keep_going } { log_and_exit } } if {[info exists tool]} { diff --git a/testsuite/runtest.main/abort.exp b/testsuite/runtest.main/abort.exp deleted file mode 100644 index 4ec0dc2..0000000 --- a/testsuite/runtest.main/abort.exp +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright (C) 1995-2016, 2018, 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. - -# This file tests handling of fatal errors in testcases. -# The way we do this is to recursively invoke ourselves on a small testsuite -# and analyze the results. - -load_lib util-defs.exp - -if {![info exists tmpdir]} { - set tmpdir [testsuite file -object -top tmpdir] -} - -set fd [open abort-init.exp w] -puts $fd "set srcdir [testsuite file -source -test abort]" -puts $fd "set objdir [testsuite file -object -test abort]" -puts $fd "set tmpdir $tmpdir" -close $fd - -if {![file isdirectory $tmpdir]} { - catch "file mkdir $tmpdir" -} - -if {![file isdirectory [testsuite file -object -test abort]]} { - catch {file mkdir [testsuite file -object -test abort]} -} - -set tests { - { "run only simple test" - "simple.exp" - "PASS: simple test.*\ - *expected passes\[ \t\]+1\n" } - { "abort on undefined command with --no_keep_going" - "--no_keep_going abort-undef.exp" - "PASS: running abort-undef.exp.*\ - *UNRESOLVED: .* aborted.*\ - *expected passes\[ \t\]+1\n.*unresolved testcases\[ \t\]+1\n" } - { "stop at divide-by-zero with --no_keep_going" - "--no_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 with --no_keep_going" - "--no_keep_going abort-al-dbz.exp simple.exp" - "PASS: running abort-al-dbz.exp.*\ - *UNRESOLVED: .* aborted.*\ - *expected passes\[ \t\]+1\n.*unresolved testcases\[ \t\]+1\n" } - { "continue after auto-loaded divide-by-zero with --keep_going" - "--keep_going abort-al-dbz.exp simple.exp" - "PASS: running abort-al-dbz.exp.*\ - *UNRESOLVED: .* aborted.*\ - *PASS: simple test.*\ - *expected passes\[ \t\]+2\n" } - { "stop at abort with --no_keep_going" - "--no_keep_going abort-undef.exp simple.exp" - "PASS: running abort-undef.exp.*\ - *UNRESOLVED: .* aborted.*\ - *expected passes\[ \t\]+1\n.*unresolved testcases\[ \t\]+1\n" } - { "continue after abort with --keep_going" - "--keep_going abort-undef.exp simple.exp" - "PASS: running abort-undef.exp.*\ - *UNRESOLVED: .* aborted.*\ - *PASS: simple test.*\ - *expected passes\[ \t\]+2\n.*unresolved testcases\[ \t\]+1\n" } -} - -foreach t $tests { - if [util_test $RUNTEST \ - "--local_init abort-init.exp\ - --outdir $tmpdir -a [lindex $t 1]" \ - "" \ - [lindex $t 2]] { - fail [lindex $t 0] - } else { - pass [lindex $t 0] - } -} - -file delete -force $tmpdir -file delete -force [testsuite file -object -test abort testsuite abort.test lib] diff --git a/testsuite/runtest.main/error.exp b/testsuite/runtest.main/error.exp new file mode 100644 index 0000000..1473ee1 --- /dev/null +++ b/testsuite/runtest.main/error.exp @@ -0,0 +1,81 @@ +# Copyright (C) 1995-2016, 2018, 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. + +# This file tests handling of fatal errors in testcases. +# The way we do this is to recursively invoke ourselves on a small testsuite +# and analyze the results. + +load_lib util-defs.exp + +if {![info exists tmpdir]} { + set tmpdir [testsuite file -object -top tmpdir] +} + +set fd [open error-init.exp w] +puts $fd "set srcdir [testsuite file -source -test error]" +puts $fd "set objdir [testsuite file -object -test error]" +puts $fd "set tmpdir $tmpdir" +close $fd + +if {![file isdirectory $tmpdir]} { + catch "file mkdir $tmpdir" +} + +if {![file isdirectory [testsuite file -object -test error]]} { + catch {file mkdir [testsuite file -object -test error]} +} + +set tests { + { "run only simple test" + "simple.exp" + "PASS: simple test.*\ + *expected passes\[ \t\]+1\n" } + { "continue after divide-by-zero, reporting error" + "error-dbz.exp simple.exp" + "PASS: running error-dbz.exp.*\ + *UNRESOLVED: .* aborted.*\ + *PASS: simple test.*\ + *expected passes\[ \t\]+2\n.*unresolved testcases\[ \t\]+1\n" } + { "continue after auto-loaded divide-by-zero, reporting error" + "error-al-dbz.exp simple.exp" + "PASS: running error-al-dbz.exp.*\ + *UNRESOLVED: .* aborted.*\ + *PASS: simple test.*\ + *expected passes\[ \t\]+2\n.*unresolved testcases\[ \t\]+1\n" } + { "continue after calling undefined procedure, reporting error" + "error-undef.exp simple.exp" + "PASS: running error-undef.exp.*\ + *UNRESOLVED: .* aborted.*\ + *PASS: simple test.*\ + *expected passes\[ \t\]+2\n.*unresolved testcases\[ \t\]+1\n" } +} + +foreach t $tests { + if [util_test $RUNTEST \ + "--local_init error-init.exp\ + --outdir $tmpdir -a [lindex $t 1]" \ + "" \ + [lindex $t 2]] { + fail [lindex $t 0] + } else { + pass [lindex $t 0] + } +} + +file delete -force $tmpdir +file delete -force [testsuite file -object -test error testsuite error.test lib] diff --git a/testsuite/runtest.main/abort/testsuite/abort.test/abort-al-dbz.exp b/testsuite/runtest.main/error/testsuite/error.test/error-al-dbz.exp index df55a9a..52b5bc3 100644 --- a/testsuite/runtest.main/abort/testsuite/abort.test/abort-al-dbz.exp +++ b/testsuite/runtest.main/error/testsuite/error.test/error-al-dbz.exp @@ -18,7 +18,7 @@ # Cause a divide-by-zero error in an auto-loaded procedure. -pass "running abort-al-dbz.exp" +pass "running error-al-dbz.exp" set fd [open [testsuite file -object -test lib foo.tcl] w] puts $fd {proc throw_arith_error_div_by_zero { } { diff --git a/testsuite/runtest.main/abort/testsuite/abort.test/abort-dbz.exp b/testsuite/runtest.main/error/testsuite/error.test/error-dbz.exp index 711347d..463337a 100644 --- a/testsuite/runtest.main/abort/testsuite/abort.test/abort-dbz.exp +++ b/testsuite/runtest.main/error/testsuite/error.test/error-dbz.exp @@ -18,7 +18,7 @@ # Cause a divide-by-zero error. -pass "running abort-dbz.exp" +pass "running error-dbz.exp" proc throw_arith_error_div_by_zero { } { expr { 1 / 0 } diff --git a/testsuite/runtest.main/abort/testsuite/abort.test/abort-undef.exp b/testsuite/runtest.main/error/testsuite/error.test/error-undef.exp index e5f4803..fa59f4a 100644 --- a/testsuite/runtest.main/abort/testsuite/abort.test/abort-undef.exp +++ b/testsuite/runtest.main/error/testsuite/error.test/error-undef.exp @@ -18,7 +18,7 @@ # Invoke an undefined command, causing a fatal error. -pass "running abort-undef.exp" +pass "running error-undef.exp" bogus_command 1 2 3 4 diff --git a/testsuite/runtest.main/abort/testsuite/abort.test/simple.exp b/testsuite/runtest.main/error/testsuite/error.test/simple.exp index 93a03e7..93a03e7 100644 --- a/testsuite/runtest.main/abort/testsuite/abort.test/simple.exp +++ b/testsuite/runtest.main/error/testsuite/error.test/simple.exp |