From 1f7ac1cf71aab35d43d4a4f16dfaf5edd1d0c2cb Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Tue, 18 May 2021 21:49:56 -0500 Subject: [PATCH] Avoid Tcl error when report-card tool fails to produce output in tests --- ChangeLog | 3 +++ testsuite/report-card.all/onetest.exp | 14 ++++++++++---- 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 + * 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" -- 2.11.4.GIT