From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3 3/4] shell lib: Add basic support for test setup
Date: Thu, 17 Jul 2025 12:26:11 +0200 [thread overview]
Message-ID: <20250717102611.GA905840@pevik> (raw)
In-Reply-To: <CAEemH2coV_yJM5Kg5JN9FVqx6b=_CLTLzhCtCfCwqHnP-_j=yA@mail.gmail.com>
Hi Li, Cyril, all,
> PM Petr Vorel <pvorel@suse.cz> wrote:
...
> > +if [ -n "$TST_CLEANUP" ]; then
> > + trap $TST_CLEANUP EXIT
> > +fi
> > +
> > +if [ -n "$TST_SETUP" ]; then
> > + $TST_SETUP
> > +fi
> > +
@Li first, thanks a lot for your feedback.
> Here maybe better to have a check before the tst_test:
> if ! declare -F tst_test > /dev/null; then
> tst_brk TBROK "tst_test() function is not defined"
> fi
Sure, I can add a check for function existence. 'declare' is a bashism,
I use 'command -v' which we already use for $TST_SETUP and $TST_CLEANUP
in tst_test.h.
if [ -n "$TST_SETUP" ]; then
if command -v $TST_SETUP >/dev/null 2>/dev/null; then
TST_DO_CLEANUP=1
$TST_SETUP
else
tst_brk TBROK "TST_SETUP=$TST_SETUP declared, but function not defined (or cmd not found)"
fi
fi
> > +tst_test
> > --
> > 2.49.0
> Sorry, I should have pointed this out at the first review, but
> the idea came to my mind a little bit delayed :).
No problem :).
@Cyril any more feedback before I'll send a new version (v4)?
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-07-17 10:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-09 12:45 [LTP] [PATCH v3 0/4] shell loader rewrite to support TST_SETUP Petr Vorel
2025-06-09 12:45 ` [LTP] [PATCH v3 1/4] shell lib: Add support for test cleanup Petr Vorel
2025-06-12 3:46 ` Li Wang via ltp
2025-06-09 12:45 ` [LTP] [PATCH v3 2/4] shell: Move shell code into functions Petr Vorel
2025-06-12 3:47 ` Li Wang via ltp
2025-06-09 12:45 ` [LTP] [PATCH v3 3/4] shell lib: Add basic support for test setup Petr Vorel
2025-06-12 5:08 ` Li Wang via ltp
2025-06-12 7:48 ` Li Wang via ltp
2025-07-17 10:26 ` Petr Vorel [this message]
2025-07-17 15:38 ` Cyril Hrubis
2025-06-09 12:45 ` [LTP] [PATCH v3 4/4] shell: Add shell_loader_setup_cleanup.sh test Petr Vorel
2025-06-12 5:08 ` Li Wang via ltp
2025-06-12 7:18 ` Li Wang via ltp
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=20250717102611.GA905840@pevik \
--to=pvorel@suse.cz \
--cc=liwang@redhat.com \
--cc=ltp@lists.linux.it \
/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.