This is an automated email from the ASF dual-hosted git repository.
swebb2066 pushed a commit to branch colorize_unit_test_output
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
The following commit(s) were added to refs/heads/colorize_unit_test_output by
this push:
new 535ca91e Add color to unit test output
535ca91e is described below
commit 535ca91e6734436a087ac4eb5bedb17cca10f4ff
Author: Stephen Webb <[email protected]>
AuthorDate: Sun Aug 31 14:14:16 2025 +1000
Add color to unit test output
---
src/test/cpp/abts.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/test/cpp/abts.cpp b/src/test/cpp/abts.cpp
index 49c47402..a548cb2d 100644
--- a/src/test/cpp/abts.cpp
+++ b/src/test/cpp/abts.cpp
@@ -88,7 +88,7 @@ static void update_status(void)
if (!quiet)
{
curr_char = (curr_char + 1) % ABTS_STAT_SIZE;
- fprintf(stdout, "%s\b%c", infoPrefix, status[curr_char]);
+ fprintf(stdout, "\b%c", status[curr_char]);
fflush(stdout);
}
}
@@ -259,10 +259,10 @@ static int report(abts_suite* suite)
if (dptr->failed.size() != 0)
{
float percent = ((float)dptr->failed.size() /
(float)dptr->num_test);
- fprintf(stdout, "%s%-35s\t\t%5d\t%4d\t%6.2f%%\n",
warnPrefix, dptr->name.c_str(),
- dptr->num_test, (int)dptr->failed.size(),
percent * 100);
+ fprintf(stdout, "%s%-35s\t\t%5d\t%4d\t%6.2f%%%s\n",
warnPrefix, dptr->name.c_str(),
+ dptr->num_test, (int)dptr->failed.size(),
percent * 100, msgSuffix);
for( const char* failed_name : dptr->failed ){
- fprintf(stdout, "%s %s%s\n", warnPrefix,
failed_name , msgSuffix);
+ fprintf(stdout, " %s%s%s\n", warnPrefix,
failed_name, msgSuffix);
}
}