Last active
January 22, 2021 22:44
-
-
Save mattmc3/6ca92822f518f702bbe26fb8c6f28c15 to your computer and use it in GitHub Desktop.
awk TAP colorizer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -S awk -f | |
# https://testanything.org | |
BEGIN { | |
CYAN="\033[0;36m" | |
GREEN="\033[0;32m" | |
RED="\033[0;31m" | |
BRIGHTGREEN="\033[1;92m" | |
BRIGHTRED="\033[1;91m" | |
NORMAL="\033[0;0m" | |
} | |
/^ok / { print GREEN $0 NORMAL; next } | |
/^not ok / { print RED $0 NORMAL; next } | |
/^\# ok$/ { print BRIGHTGREEN $0 NORMAL; next } | |
/^\# pass / { print BRIGHTGREEN $0 NORMAL; next } | |
/^\# fail / { print BRIGHTRED $0 NORMAL; next } | |
/^\#/ { print CYAN $0 NORMAL; next } | |
{ print $0 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment