]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests/shell: colorize NFT_TEST_SKIP_/NFT_TEST_HAVE_ in test output
authorThomas Haller <thaller@redhat.com>
Fri, 15 Sep 2023 15:32:36 +0000 (17:32 +0200)
committerFlorian Westphal <fw@strlen.de>
Sat, 16 Sep 2023 12:43:37 +0000 (14:43 +0200)
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

index 01a312d0ee2cc18f0e6c5276f3dfc928a21c75e7..1527b2a6455cd5e34d8fa42b4fecf17b4ead73bd 100755 (executable)
@@ -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