Linux Test Project
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [RFC PATCH v6 3/5] tst_test.sh: Filter out commented out lines from warnings
Date: Mon, 4 Jun 2018 23:34:20 +0200	[thread overview]
Message-ID: <20180604213420.GA2783@x230> (raw)
In-Reply-To: <20180604210628.GA19509@rei.lan>

Hi Cyril,


> Hi!
> What is the usecase for this?

> I know that comments does not count as a code but why would the test
> need to comment with a reserved name in it?
OK, let's drop it.

> > ---
> >  testcases/lib/tst_test.sh | 12 ++++++++++--
> >  1 file changed, 10 insertions(+), 2 deletions(-)

> > diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
> > index de5d65039..098ff7bd2 100644
> > --- a/testcases/lib/tst_test.sh
> > +++ b/testcases/lib/tst_test.sh
> > @@ -244,13 +244,21 @@ _tst_rescmp()
> >  	fi
> >  }

> > +_tst_get_used_var()
> > +{
> > +	local _tst_pattern="$1"
> > +
> > +	grep $_tst_pattern "$TST_TEST_PATH" | grep -v '^[[:space:]]*#' | \
> > +		sed "s/.*${_tst_pattern}//;"' s/[="} \t\/:`].*//'

> As far as I can tell this does not work for:

> foo # run function foo
Not sure what you expected. The behavior is:

* no warning for:
  # _tst_foo run function _tst_foo

* warning for:
  _tst_foo # run function _tst_foo

I take it as your NACK anyway :).

Kind regards,
Petr

  reply	other threads:[~2018-06-04 21:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01  7:28 [LTP] [RFC PATCH v6 0/5] Add TST_TEST_DATA and TST_TEST_DATA_IFS + cleanup Petr Vorel
2018-06-01  7:28 ` [LTP] [RFC PATCH v6 1/5] tst_test.sh: Hide "private" variables with "_tst_" prefix Petr Vorel
2018-06-01  7:28 ` [LTP] [RFC PATCH v6 2/5] tst_test.sh: Warn about using "private" variable or function Petr Vorel
2018-06-01  7:28 ` [LTP] [RFC PATCH v6 3/5] tst_test.sh: Filter out commented out lines from warnings Petr Vorel
2018-06-04 21:06   ` Cyril Hrubis
2018-06-04 21:34     ` Petr Vorel [this message]
2018-06-05 14:38       ` Cyril Hrubis
2018-06-01  7:28 ` [LTP] [RFC PATCH v6 4/5] tst_test.sh: s/resm/res/ Petr Vorel
2018-06-01  7:28 ` [LTP] [RFC PATCH v6 5/5] tst_test.sh: Add TST_TEST_DATA and TST_TEST_DATA_IFS Petr Vorel
2018-06-05 15:09   ` Cyril Hrubis
2018-06-05 18:43     ` 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=20180604213420.GA2783@x230 \
    --to=pvorel@suse.cz \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox