aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Bachmeyer <jcb@gnu.org>2021-05-18 21:49:56 -0500
committerJacob Bachmeyer <jcb@gnu.org>2021-05-18 21:49:56 -0500
commit1f7ac1cf71aab35d43d4a4f16dfaf5edd1d0c2cb (patch)
tree11dd52416e159fdf58eb9667afc7cc03b747228f
parent531c8aa5acc8b7ccb40fc255bec038f8d8e02983 (diff)
Avoid Tcl error when report-card tool fails to produce output in tests
-rw-r--r--ChangeLog3
-rw-r--r--testsuite/report-card.all/onetest.exp14
2 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 1544385..232db1d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2021-05-18 Jacob Bachmeyer <jcb@gnu.org>
+ * testsuite/report-card.all/onetest.exp: Avoid Tcl error when item
+ and totals lines are missing entirely.
+
* testsuite/runtest.main/pr48155.exp: Fix assumption about exit
code from /bin/false, which is different on Solaris.
diff --git a/testsuite/report-card.all/onetest.exp b/testsuite/report-card.all/onetest.exp
index b2ae814..fcebdf7 100644
--- a/testsuite/report-card.all/onetest.exp
+++ b/testsuite/report-card.all/onetest.exp
@@ -193,11 +193,17 @@ foreach name $test_names {
}
# skip the footer
expect -re {.+} { exp_continue }
- # do the item and totals lines match?
- if { $item_line eq $totals_line } {
- pass "verify total for $name"
+ # were item and totals lines even produced?
+ if { [info exists item_line] && [info exists totals_line] } {
+ # do the item and totals lines match?
+ if { $item_line eq $totals_line } {
+ pass "verify total for $name"
+ } else {
+ fail "verify total for $name"
+ }
} else {
- fail "verify total for $name"
+ # either an item line or the totals line was not seen
+ unresolved "verify total for $name"
}
if { $separator_count == 2 } {
pass "expected separator lines for $name"