Linux Test Project
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@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:06:29 +0200	[thread overview]
Message-ID: <20180604210628.GA19509@rei.lan> (raw)
In-Reply-To: <20180601072838.13196-4-pvorel@suse.cz>

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?

> ---
>  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

> +}

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2018-06-04 21:06 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 [this message]
2018-06-04 21:34     ` Petr Vorel
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=20180604210628.GA19509@rei.lan \
    --to=chrubis@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