diff options
author | Jacob Bachmeyer <jcb62281+dev@gmail.com> | 2020-06-24 21:14:28 -0500 |
---|---|---|
committer | Jacob Bachmeyer <jcb62281+dev@gmail.com> | 2020-06-24 21:14:28 -0500 |
commit | 5bc0f51cebd001b6ba92cdd3e98e97111d96cccb (patch) | |
tree | c4e01e6f18482613975a5e9b55005095c20c75e5 | |
parent | a53c5648ea1b1d195f290f51450af2e9b05a3089 (diff) | |
download | dejagnu-5bc0f51cebd001b6ba92cdd3e98e97111d96cccb.zip dejagnu-5bc0f51cebd001b6ba92cdd3e98e97111d96cccb.tar.gz dejagnu-5bc0f51cebd001b6ba92cdd3e98e97111d96cccb.tar.bz2 |
Add option to stop immediately at Tcl errors and continue by default
-rw-r--r-- | ChangeLog | 19 | ||||
-rw-r--r-- | NEWS | 12 | ||||
-rw-r--r-- | doc/dejagnu.texi | 3 | ||||
-rw-r--r-- | doc/runtest.1 | 6 | ||||
-rw-r--r-- | runtest.exp | 9 | ||||
-rw-r--r-- | testsuite/runtest.main/abort.exp | 16 |
6 files changed, 48 insertions, 17 deletions
@@ -1,3 +1,22 @@ +2020-06-24 Jacob Bachmeyer <jcb62281+dev@gmail.com> + + PR 41824 / PR 41918 + + * NEWS: Revise relevant items. + + * doc/dejagnu.texi (Invoking runtest): Add --no_keep_going option. + * doc/runtest.1: Document --no_keep_going option. Remove + long-obsolete --name option. The --name option had been removed + from runtest before the code was imported into what became the + current repository. + + * runtest.exp: Add option --no_keep_going to stop immediately if a + test script aborts due to a Tcl error. Remove vestiges of + long-obsolete --name option. Make --keep_going option default. + + * testsuite/runtest.main/abort.exp: Adjust tests to use + --no_keep_going and --keep_going instead of assuming a default. + 2020-06-19 Jacob Bachmeyer <jcb62281+dev@gmail.com> Merge patches from Tom de Vries <tdevries <at> suse.de> and write @@ -7,10 +7,16 @@ Changes since 1.6.2: should use this proc. The 'is_remote' proc is deprecated. 2. runtest now accepts --local_init and --global_init options to override the default of reading "site.exp". See the manual for details. -X. runtest now aborts if a test script fails with any Tcl error. Previously, - only calling an undefined procedure would cause the test run to abort. +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. + 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 cd8c4e9..49653ea 100644 --- a/doc/dejagnu.texi +++ b/doc/dejagnu.texi @@ -649,6 +649,9 @@ 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 e8913b1..ae04b6f 100644 --- a/doc/runtest.1 +++ b/doc/runtest.1 @@ -48,6 +48,9 @@ Do not run the specified tests. .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. @@ -59,9 +62,6 @@ Emit Expect output to standard output. .BI --mail \ \'name1\ name2\ ...\' Electronic mail addresses to receive test results. .TP -.BI --name \ HOSTNAME -The network HOSTNAME of the target board. -.TP .BI --objdir \ PATH \fIPATH\fR is a directory containing compiled test code. .TP diff --git a/runtest.exp b/runtest.exp index 245c536..6f7e557 100644 --- a/runtest.exp +++ b/runtest.exp @@ -101,7 +101,7 @@ set testbuilddir "testsuite" ;# top-level testsuite object directory # These are used for internal command-line flags. # namespace eval ::dejagnu::opt { - variable keep_going 0 ;# continue after a fatal error in testcase? + variable keep_going 1 ;# continue after a fatal error in testcase? } # Various ccache versions provide incorrect debug info such as ignoring @@ -380,6 +380,7 @@ proc usage { } { 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" @@ -474,7 +475,6 @@ for { set i 0 } { $i < $argc } { incr i } { "--ig*" - "--loc*" - "--m*" - - "--n*" - "--ob*" - "--ou*" - "--sr*" - @@ -1127,7 +1127,6 @@ for { set i 0 } { $i < $argc } { incr i } { "--ig*" - "--loc*" - "--m*" - - "--n*" - "--ob*" - "--ou*" - "--sr*" - @@ -1213,6 +1212,10 @@ for { set i 0 } { $i < $argc } { incr i } { 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 diff --git a/testsuite/runtest.main/abort.exp b/testsuite/runtest.main/abort.exp index 59a934c..4ec0dc2 100644 --- a/testsuite/runtest.main/abort.exp +++ b/testsuite/runtest.main/abort.exp @@ -45,13 +45,13 @@ set tests { "simple.exp" "PASS: simple test.*\ *expected passes\[ \t\]+1\n" } - { "abort on undefined command" - "abort-undef.exp" + { "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 without --keep_going" - "abort-dbz.exp simple.exp" + { "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" } @@ -61,8 +61,8 @@ set tests { *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" + { "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" } @@ -72,8 +72,8 @@ set tests { *UNRESOLVED: .* aborted.*\ *PASS: simple test.*\ *expected passes\[ \t\]+2\n" } - { "stop at abort without --keep_going" - "abort-undef.exp simple.exp" + { "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" } |