All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [RFC PATCH v4 3/4] lib/tst_test.sh: Warn about using "private" variable or function
Date: Thu, 24 May 2018 17:21:28 +0200	[thread overview]
Message-ID: <20180524152129.1067-3-pvorel@suse.cz> (raw)
In-Reply-To: <20180524152129.1067-1-pvorel@suse.cz>

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/tst_test.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index a5f0ab288..cdcd33ced 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -259,6 +259,10 @@ tst_run()
 			*) tst_res TWARN "Reserved variable TST_$_tst_i used!";;
 			esac
 		done
+
+		for _tst_i in $(grep _tst_ "$TST_TEST_PATH" | sed 's/.*_tst_//; s/[="} \t\/:`].*//'); do
+			tst_res TWARN "Private variable or function _tst_$_tst_i used!"
+		done
 	fi
 
 	local _tst_name
-- 
2.16.3


  parent reply	other threads:[~2018-05-24 15:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-24 15:21 [LTP] [RFC PATCH v4 1/4] lib/tst_test.sh: Fix test name function detection for TST_CNT Petr Vorel
2018-05-24 15:21 ` [LTP] [RFC PATCH v4 2/4] lib/tst_test.sh: Hide "private" variables with "_tst_" prefix Petr Vorel
2018-05-24 15:21 ` Petr Vorel [this message]
2018-05-24 15:21 ` [LTP] [RFC PATCH v4 4/4] tst_test.sh: Add TST_TEST_DATA and TST_TEST_DATA_IFS Petr Vorel
2018-05-25  9:42   ` Cyril Hrubis
2018-05-25 12:10     ` Petr Vorel
2018-05-25 12:23       ` Cyril Hrubis
2018-05-25 15:53         ` Petr Vorel
2018-05-25 16:01 ` [LTP] [RFC PATCH v4 1/4] lib/tst_test.sh: Fix test name function detection for TST_CNT 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=20180524152129.1067-3-pvorel@suse.cz \
    --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 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.