All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Schmitt via Grub-devel <grub-devel@gnu.org>
To: grub-devel@gnu.org
Cc: Thomas Schmitt <scdbackup@gmx.net>, development@efficientek.com
Subject: Re: [PATCH 0/4] Various test fixes proposed by Thomas Schmitt
Date: Wed, 02 Oct 2024 09:08:23 +0200	[thread overview]
Message-ID: <9642307878491492323@scdbackup.webframe.org> (raw)
In-Reply-To: <20240930224943.77cad5a9@crass-HP-ZBook-15-G2>

Hi,

i wrote:
> > Assuming variable "xfail" is be set to a non-empty string exactly if
> > argument "--xfail" is given, i'd replace:
> >
> >     if [ -z "$debug" ] && [ "${RET:-1}" -eq 0 ]; then
> >         rm -rf "$lukstestdir" || :
> >     fi

Glenn Washburn wrote:
> RET should never be undefined because $? always has a numerical value.
> And in my change I default xfail to 0. So I change the if statement to:
>
>  if [ -z "$debug" ] && [ "$RET" -eq "$xfail" ]; then
>
> This is a lot simpler, though perhaps a tad less clear. Do you see a
> reason why this is less desirable?

If indeed in a successful --xfail test RET must have the value of "$xfail"
(i guess 1), then it is concise and sufficient.

If other non-zero values of RET are acceptable as indication of an
intended failure then your proposal is too sparse.
In this case i would propose to flatly enumerate the two cases which shall
lead to removal of the test data:

    if [ -z "$debug" ] && [ "$xfail" -eq 1 ] && [ "$RET" -ne 0 ]; then
        rm -rf "$lukstestdir" || :
    elif [ -z "$debug" ] && [ "$xfail" -eq 0 ] && [ "$RET" -eq 0 ]; then
        rm -rf "$lukstestdir" || :
    fi


Have a nice day :)

Thomas


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

  reply	other threads:[~2024-10-02  7:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-23  5:53 [PATCH 0/4] Various test fixes proposed by Thomas Schmitt Glenn Washburn
2024-09-23  5:53 ` [PATCH 1/4] tests/util/grub-shell-luks-tester: Add missing line to create RET variable in cleanup Glenn Washburn
2024-09-23 16:36   ` Thomas Schmitt via Grub-devel
2024-09-24  7:21     ` Thomas Schmitt via Grub-devel
2024-09-23  5:53 ` [PATCH 2/4] tests: Cleaup the cryptsetup script in grub_cmd_cryptomount unless debug is enabled Glenn Washburn
2024-09-23  5:53 ` [PATCH 3/4] tests: Default TMPDIR to /tmp in grub_cmd_cryptomount tests Glenn Washburn
2024-09-23  5:53 ` [PATCH 4/4] tests/util/grub-shell: Remove the work directory on successful run and debug is not on Glenn Washburn
2024-09-23 15:52 ` [PATCH 0/4] Various test fixes proposed by Thomas Schmitt Thomas Schmitt via Grub-devel
2024-09-26 19:19   ` Glenn Washburn
2024-09-26 20:44     ` Thomas Schmitt via Grub-devel
2024-09-26 22:21       ` Glenn Washburn
2024-09-27 11:59         ` Thomas Schmitt via Grub-devel
2024-10-01  3:49           ` Glenn Washburn
2024-10-02  7:08             ` Thomas Schmitt via Grub-devel [this message]
2024-10-05 20:11               ` Glenn Washburn
2024-10-06  6:48                 ` Thomas Schmitt via Grub-devel

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=9642307878491492323@scdbackup.webframe.org \
    --to=grub-devel@gnu.org \
    --cc=development@efficientek.com \
    --cc=scdbackup@gmx.net \
    /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.