diff mbox series

[meta-oe,master,scarthgap] hiredis: remove ANSI color from ptest result

Message ID 20240722085846.1599546-1-peng.zhang1.cn@windriver.com
State Accepted
Headers show
Series [meta-oe,master,scarthgap] hiredis: remove ANSI color from ptest result | expand

Commit Message

peng.zhang1.cn@windriver.com July 22, 2024, 8:58 a.m. UTC
From: Zhang Peng <peng.zhang1.cn@windriver.com>

This change removes the ANSI color codes from the
ptest result.

Signed-off-by: Zhang Peng <peng.zhang1.cn@windriver.com>
---
 meta-oe/recipes-extended/hiredis/hiredis/run-ptest | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/hiredis/hiredis/run-ptest b/meta-oe/recipes-extended/hiredis/hiredis/run-ptest
index 8d450b881..8b352c340 100644
--- a/meta-oe/recipes-extended/hiredis/hiredis/run-ptest
+++ b/meta-oe/recipes-extended/hiredis/hiredis/run-ptest
@@ -2,17 +2,17 @@ 
 
 TEST_SSL=0 TEST_ASYNC=0 ./test.sh | sed -e 's/PASSED/PASS/g' -e 's/FAILED/FAIL/g' -e 's/SKIPPED/SKIP/g' | awk '
 {
-    if ($NF == "\033[0;32mPASS\033[0;0m" || $NF == "\033[0;31mFAIL\033[0;0m" || $NF == "\033[01;33mSKIP\033[0;0m") {
+    gsub(/\x1B\[[0-9;]*m/, "")
+    if ($NF == "PASS" || $NF == "FAIL" || $NF == "SKIP") {
         printf "%s: %s\n", $NF, $0
     } else {
         print
     }
-}'| awk '{
-    if ($NF == "\033[0;32mPASS\033[0;0m" || $NF == "\033[0;31mFAIL\033[0;0m" || $NF == "\033[01;33mSKIP\033[0;0m") {
+}' | awk '{
+    if ($NF == "PASS" || $NF == "FAIL" || $NF == "SKIP") {
         $NF = ""
         print $0
     } else {
-    print
-    }       
+        print
+    }
 }' | awk '{gsub(/:/,"",$NF)}1'
-