From 5bd3c262bba6bdc683d766713a7af87b56ef175c Mon Sep 17 00:00:00 2001 From: heck Date: Wed, 16 Jun 2021 16:39:04 +0200 Subject: [PATCH] Tests: PityTest - Exit status is green if 0, otherwise red --- test/pitytest11/src/PityUnit.hxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/pitytest11/src/PityUnit.hxx b/test/pitytest11/src/PityUnit.hxx index 878cf16..4d9dfd3 100644 --- a/test/pitytest11/src/PityUnit.hxx +++ b/test/pitytest11/src/PityUnit.hxx @@ -376,8 +376,14 @@ namespace pEp { int status; pid_t pid; while ((pid = wait(&status)) > 0) { + std::string color; + if(status == 0) { + color ="\033[1m\033[32m"; // Green + } else { + color ="\033[1m\033[31m"; // Red + } logH3( - "\033[1m\033[31mPROCESS [ " + std::to_string((int)pid) + + color + "PROCESS [ " + std::to_string((int)pid) + " ] EXITED with status code: " + std::to_string(status) + Utils::to_termcol(_termColor())); }