New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ISPN-8414 Colored testsuite progress #5610
ISPN-8414 Colored testsuite progress #5610
Conversation
b437db5
to
1142f9f
Compare
private static final Logger log = Logger.getLogger(TestSuiteProgress.class); | ||
private static final char ESC = (char) 27; | ||
private static final String RED = string(ESC, '[', '3', '1', 'm'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anything wrong with RED = "\u001b[31m"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the way I'm doing it is a leftover from some preprocessing I had to play nice with Surefire's way of encoding special chars. I'll fix that.
} | ||
|
||
private static void consoleLog(String message) { | ||
System.out.println("[" + TestSuiteProgress.class.getSimpleName() + "] " + message); | ||
public static String string(char... chars) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess God did not want us to have a String
constructor taking a variable number of chars for a reason... :)
Everything looks awesome, aside from my nitpicking on string theory :) |
1142f9f
to
e353378
Compare
if (useColor) { | ||
progress(color + message + RESET); | ||
} else | ||
progress(message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not using curly on the else
branch? :)
e353378
to
83e078c
Compare
@anistor fixed all ! |
skipped.get(); | ||
consoleLog(message); | ||
synchronized void progress(CharSequence message) { | ||
out.printf("[OK: %5s, KO: %5s, SKIP: %5s] %s\n", succeeded.get(), failed.get(), skipped.get(), message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could not test this on Windows to see if it matters, but was thinking maybe we should use %n
instead of \n
for maximum crossplatform compat.
Integrated in master. Thanks @tristantarrant ! |
https://issues.jboss.org/browse/ISPN-8414
All new and improved: