Skip to content

Commit

Permalink
TracingSuite: add stacktrace to stdout
Browse files Browse the repository at this point in the history
Otherwise it's hard to tell which test failed when/first if error are
collected in other logfiles only.
  • Loading branch information
EcljpseB0T committed Oct 11, 2024
1 parent 26091a5 commit e44c908
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ public void fireTestStarted(Description description) throws StoppedByUserExcepti

@Override
public void fireTestFailure(Failure failure) {
if (fTracingOptions.logTestStart()) {
if (failure.getException() != null) {
Date start = new Date();
String message = format(start, failure.getDescription());
System.out.println(message + " failed:");
failure.getException().printStackTrace(System.out);
}
}
fNotifier.fireTestFailure(failure);
}

Expand Down Expand Up @@ -261,7 +269,7 @@ static class ThreadDump extends Exception {

private static String format(Date time, Description description) {
String now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z", Locale.US).format(time);
String message = "[" + now + "] " + description.getClassName() + "#" + description.getMethodName() + "()";
String message = "[" + now + "] " + description.getClassName() + "." + description.getMethodName() + "()";
return message;
}

Expand Down

0 comments on commit e44c908

Please sign in to comment.