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 4/6] check: introduce post-test hook and CLI option
Date: Thu, 26 Nov 2026 05:28:21 +0800 [thread overview]
Message-ID: <20261125212823.3389430-5-zlang@kernel.org> (raw)
In-Reply-To: <20261125212823.3389430-1-zlang@kernel.org>
Add the --hook-post-test option to run matching hooks right after
each test finishes (before golden output comparison), passing the
test's exit code.
Signed-off-by: Zorro Lang <zlang@kernel.org>
---
check | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/check b/check
index a90b2d6d..06c67cb2 100755
--- a/check
+++ b/check
@@ -79,6 +79,9 @@ General options:
--hook-pre-test path=script[,mode=in|out][,match=glob]...
run a hook before each matching test; may be
given multiple times
+ --hook-post-test path=script[,mode=in|out][,match=glob]...
+ run a hook after 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:
@@ -392,7 +395,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:"
+ local long_opts="fs:,exact-order,large-fs,extra-space:,udiff,help,hook-pre-test:,hook-post-test:"
compat_old_option "$@"
@@ -497,6 +500,10 @@ parse_check_args()
_hook_parse_args pre-test "$2"
shift
;;
+ --hook-post-test)
+ _hook_parse_args post-test "$2"
+ shift
+ ;;
--large-fs)
export LARGE_SCRATCH_DEV=yes
;;
@@ -1109,6 +1116,7 @@ function run_section()
_run_seq >$tmp.out 2>&1
sts=$?
fi
+ _hook_run_event post-test "$seqnum" "$sts"
# If someone sets kernel.core_pattern or kernel.core_uses_pid,
# coredumps generated by fstests might have a longer name than
--
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 ` Zorro Lang [this message]
2026-11-25 21:28 ` [PATCH 5/6] check: introduce post-result " Zorro Lang
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-5-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.