netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Haller <thaller@redhat.com>
To: NetFilter <netfilter-devel@vger.kernel.org>
Cc: Thomas Haller <thaller@redhat.com>
Subject: [PATCH nft 2/2] tests/shell: colorize NFT_TEST_SKIP_/NFT_TEST_HAVE_ in test output
Date: Fri, 15 Sep 2023 17:32:36 +0200	[thread overview]
Message-ID: <20230915153515.1315886-3-thaller@redhat.com> (raw)
In-Reply-To: <20230915153515.1315886-1-thaller@redhat.com>

Having a "SKIP" option as "y" or a "HAVE" option as "n", is note worthy
because tests may be skipped based on that.

Colorize, to make it easier to see in the test output.

Signed-off-by: Thomas Haller <thaller@redhat.com>
---
 tests/shell/run-tests.sh | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh
index 01a312d0ee2c..1527b2a6455c 100755
--- a/tests/shell/run-tests.sh
+++ b/tests/shell/run-tests.sh
@@ -571,11 +571,19 @@ msg_info "conf: NFT_TEST_SHUFFLE_TESTS=$NFT_TEST_SHUFFLE_TESTS"
 msg_info "conf: TMPDIR=$(printf '%q' "$_TMPDIR")"
 echo
 for KEY in $(compgen -v | grep '^NFT_TEST_SKIP_' | sort) ; do
-	msg_info "conf: $KEY=$(printf '%q' "${!KEY}")"
+	v="${!KEY}"
+	if [ "$v" = y ] ; then
+		v="$YELLOW$v$RESET"
+	fi
+	msg_info "conf: $KEY=$v"
 	export "$KEY"
 done
 for KEY in $(compgen -v | grep '^NFT_TEST_HAVE_' | sort) ; do
-	msg_info "conf: $KEY=$(printf '%q' "${!KEY}")"
+	v="${!KEY}"
+	if [ "$v" = n ] ; then
+		v="$YELLOW$v$RESET"
+	fi
+	msg_info "conf: $KEY=$v"
 	export "$KEY"
 done
 
-- 
2.41.0


      parent reply	other threads:[~2023-09-15 15:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-15 15:32 [PATCH nft 0/2] tests/shell: add feature probing via "features/*.nft" files Thomas Haller
2023-09-15 15:32 ` [PATCH nft 1/2] " Thomas Haller
2023-09-15 15:32 ` Thomas Haller [this message]

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=20230915153515.1315886-3-thaller@redhat.com \
    --to=thaller@redhat.com \
    --cc=netfilter-devel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).