public class Failures
| Modifier and Type | Method and Description |
|---|---|
java.lang.AssertionError |
failure(java.lang.String message,
java.lang.Throwable cause)
Creates an AssertionError with the given message and cause
|
boolean |
getShouldRemoveKotlintestElementsFromStacktrace()
Whether KotlinTest-related frames will be removed from the stack traces of thrown AssertionErrors.
|
void |
removeKotlintestElementsFromStacktrace(java.lang.Throwable throwable)
Remove KotlinTest-related elements from the top of throwable's stack trace.
|
void |
setShouldRemoveKotlintestElementsFromStacktrace(boolean p)
Whether KotlinTest-related frames will be removed from the stack traces of thrown AssertionErrors.
|
public static Failures INSTANCE
public boolean getShouldRemoveKotlintestElementsFromStacktrace()
Whether KotlinTest-related frames will be removed from the stack traces of thrown AssertionErrors.
This defaults to true. You can change it by setting the system property kotlintest.failures.stacktrace.clean
or at runtime, by reassigning this var.
E.g.:
-Dkotlintest.failures.stacktrace.clean=false
or
Failures.shouldRemoveKotlintestElementsFromStacktrace = false
public void setShouldRemoveKotlintestElementsFromStacktrace(boolean p)
Whether KotlinTest-related frames will be removed from the stack traces of thrown AssertionErrors.
This defaults to true. You can change it by setting the system property kotlintest.failures.stacktrace.clean
or at runtime, by reassigning this var.
E.g.:
-Dkotlintest.failures.stacktrace.clean=false
or
Failures.shouldRemoveKotlintestElementsFromStacktrace = false
public java.lang.AssertionError failure(java.lang.String message,
java.lang.Throwable cause)
Creates an AssertionError with the given message and cause
If Failures.getShouldRemoveKotlintestElementsFromStacktrace is true, the stacktrace will be reduced to the user-code
StackTrace only.
public void removeKotlintestElementsFromStacktrace(java.lang.Throwable throwable)
Remove KotlinTest-related elements from the top of throwable's stack trace.
If no KotlinTest-related elements are present in the stack trace, it is unchanged.