All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/4] testcases/lib/run_tests.sh: Check expected results
Date: Mon, 9 Dec 2024 11:13:48 +0100	[thread overview]
Message-ID: <20241209101348.GA206052@pevik> (raw)
In-Reply-To: <CAEemH2fC96s866abHj7mk315GBP3Y1c+uSC-NhuG7P5ia2obKA@mail.gmail.com>

Hi Li, all,

...
> We could add a blank line print here to make the output better readable.

>   echo ""

> +               echo "*** Running '$test' (exp: $(tst_mask2flag $exp)) ***"

+1


> > +               $test
> > +               rc=$?
> > +               if [ $rc = 127 ]; then
> > +                       echo "Test '$test' not found, maybe out-of-tree
> > build and unset builddir?" >&2
> > +                       exit 1
> > +               elif [ $rc = 2 -a $WHITELIST_GITHUB = 1 -a
> > "$GITHUB_ACTIONS" ]; then


> If one or more variables used in the conditional test are
> either unset or empty, that will lead to invalid syntax.

> So I would suggest using [ ... ] and &&:

>   elif [ $rc = 2 ] && [ $WHITELIST_GITHUB = 1 ] && [ -n "$GITHUB_ACTIONS"
> ]; then

Good point. Or maybe just quote?

elif [ "$rc" = 2 -a "$WHITELIST_GITHUB" = 1 -a "$GITHUB_ACTIONS" ]; then

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2024-12-09 10:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-06  9:49 [LTP] [PATCH 0/4] ci: run shell loader tests Petr Vorel
2024-12-06  9:49 ` [LTP] [PATCH 1/4] testcases/lib/run_tests.sh: Check expected results Petr Vorel
2024-12-09  9:42   ` Li Wang
2024-12-09 10:13     ` Petr Vorel [this message]
2024-12-10  2:07       ` Li Wang
2024-12-10  6:59         ` Petr Vorel
2024-12-10  7:33           ` Li Wang
2024-12-06  9:49 ` [LTP] [PATCH 2/4] Makefile: Add target to run shell loader Petr Vorel
2024-12-06  9:49 ` [LTP] [PATCH 3/4] build.sh: Allow to run shell loader tests Petr Vorel
2024-12-06  9:49 ` [LTP] [PATCH 4/4] ci: Add " Petr Vorel

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=20241209101348.GA206052@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.