ref: 44cdcd12c386916e4f4b3e9f24eb94189ba4f811
parent: ed06981f57cc9913a3d61b98e3708efe116e3010
author: ISSOtm <eldredhabert0@gmail.com>
date: Tue Jan 28 16:04:01 EST 2020
Use `tput` for formatting escape sequences
--- a/test/asm/test.sh
+++ b/test/asm/test.sh
@@ -8,12 +8,16 @@
errput=$(mktemp)
rc=0
+bold=$(tput bold)
+resbold=$(tput sgr0)
+red=$(tput setaf 1)
+rescolors=$(tput op)
tryDiff () {
- diff -u --strip-trailing-cr $1 $2 || (echo -e "\033[1;31m${i%.asm}.$3$variant mismatch!\033[0;0m"; false)
+ diff -u --strip-trailing-cr $1 $2 || (echo -e "${bold}${red}${i%.asm}${variant}.$3 mismatch!${rescolors}${resbold}"; false)
}
tryCmp () {
- cmp $1 $2 || (echo -e "\033[1;31m${i%.asm}.bin$variant mismatch!\033[0;0m"; false)
+ cmp $1 $2 || (echo -e "${bold}${red}${i%.asm}${variant}.out.bin mismatch!${rescolors}${resbold}"; false)
}
for i in *.asm; do