From: Zorro Lang <zlang@kernel.org>
To: fstests@vger.kernel.org
Cc: Andrey Albershteyn <aalbersh@redhat.com>,
cem@kernel.org, Dave Chinner <david@fromorbit.com>,
linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
linux-ext4@vger.kernel.org
Subject: [PATCH 5/6] check: introduce post-result hook and CLI option
Date: Thu, 26 Nov 2026 05:28:22 +0800 [thread overview]
Message-ID: <20261125212823.3389430-6-zlang@kernel.org> (raw)
In-Reply-To: <20261125212823.3389430-1-zlang@kernel.org>
Add the --hook-post-result option to run matching hooks once each
test's final result (pass/fail/notrun/expunge) is determined, passing
the result and runtime. Hooks run even when no report format (-R) is
requested.
Signed-off-by: Zorro Lang <zlang@kernel.org>
---
check | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/check b/check
index 06c67cb2..5c4f16a8 100755
--- a/check
+++ b/check
@@ -82,6 +82,9 @@ General options:
--hook-post-test path=script[,mode=in|out][,match=glob]...
run a hook after each matching test; may be
given multiple times
+ --hook-post-result path=script[,mode=in|out][,match=glob]...
+ run a hook with the result of each matching test;
+ may be given multiple times
--exact-order run tests in the exact order specified
--extra-space <size> require minimum free space on scratch device
--fs <type> test the given FSTYP; valid types include:
@@ -395,7 +398,7 @@ process_remain_tests()
parse_check_args()
{
local short_opts="g:x:X:e:E:s:S:lnri:I:TdbR:L:h"
- local long_opts="fs:,exact-order,large-fs,extra-space:,udiff,help,hook-pre-test:,hook-post-test:"
+ local long_opts="fs:,exact-order,large-fs,extra-space:,udiff,help,hook-pre-test:,hook-post-test:,hook-post-result:"
compat_old_option "$@"
@@ -504,6 +507,10 @@ parse_check_args()
_hook_parse_args post-test "$2"
shift
;;
+ --hook-post-result)
+ _hook_parse_args post-result "$2"
+ shift
+ ;;
--large-fs)
export LARGE_SCRATCH_DEV=yes
;;
@@ -783,6 +790,8 @@ _stash_test_status() {
_make_testcase_report "$section" "$test_seq" \
"$test_status" "$((stop - start))"
fi
+ _hook_run_event post-result "$test_seq" "$test_status" \
+ "$((stop - start))"
if ((${#loop_status[*]} > 0)); then
# continuing or completing rerun-on-failure loop
--
2.56.0
next prev parent reply other threads:[~2026-11-25 21:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 21:28 [PATCH 0/6] Add test hook infrastructure Zorro Lang
2026-11-25 21:28 ` [PATCH 1/6] common: add builtin " Zorro Lang
2026-11-25 21:28 ` [PATCH 2/6] common: add out-of-process hook mode Zorro Lang
2026-11-25 21:28 ` [PATCH 3/6] check: introduce pre-test hook and CLI option Zorro Lang
2026-11-25 21:28 ` [PATCH 4/6] check: introduce post-test " Zorro Lang
2026-11-25 21:28 ` Zorro Lang [this message]
2026-11-25 21:28 ` [PATCH 6/6] doc: document the test hooks Zorro Lang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261125212823.3389430-6-zlang@kernel.org \
--to=zlang@kernel.org \
--cc=aalbersh@redhat.com \
--cc=cem@kernel.org \
--cc=david@fromorbit.com \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.