From 210af953f70974ec794b40f7f8769c5637df77da Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Tue, 13 Dec 2022 00:08:20 +0100 Subject: [PATCH] check: ensure sect_stop is initialized if interrupted sect_stop is normally set immediately prior to calling _wrapup() via run_section(). However, when called via a trap signal handler, sect_stop may be uninitialized, leading to a negative section time (sect_stop - sect_start) in the xunit report. E.g. Interrupted! Passed all 1 tests Xunit report: /home/david/xfstests/results//result.xml rapido1:/# head /home/david/xfstests/results//result.xml This commit uses the existing $interrupt flag to determine when sect_stop needs to be initialised. Signed-off-by: David Disseldorp Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- check | 1 + 1 file changed, 1 insertion(+) diff --git a/check b/check index f7f93dc4..1022e853 100755 --- a/check +++ b/check @@ -433,6 +433,7 @@ _wrapup() { seq="check" check="$RESULT_BASE/check" + $interrupt && sect_stop=`_wallclock` if $showme && $needwrap; then if $do_report; then -- 2.39.5