[tests] makes check_stacktrace_format enabled again
This commit is contained in:
@@ -2081,7 +2081,7 @@ task extend_exception(type: RunKonanTest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
task check_stacktrace_format(type: RunStandaloneKonanTest) {
|
task check_stacktrace_format(type: RunStandaloneKonanTest) {
|
||||||
disabled = true // !isAppleTarget(project)
|
disabled = !isAppleTarget(project) || project.globalTestArgs.contains('-opt')
|
||||||
flags = ['-g']
|
flags = ['-g']
|
||||||
source = "runtime/exceptions/check_stacktrace_format.kt"
|
source = "runtime/exceptions/check_stacktrace_format.kt"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,15 +29,14 @@ fun functionB() {
|
|||||||
functionA()
|
functionA()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const val depth = 5
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main(args : Array<String>) {
|
||||||
try {
|
try {
|
||||||
functionB()
|
functionB()
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
val stacktrace = e.getStackTrace()
|
val stacktrace = e.getStackTrace()
|
||||||
if (stacktrace.size >= 3) {
|
assert(stacktrace.size >= depth)
|
||||||
repeat(3) {
|
stacktrace.take(depth).forEach(::checkStringFormat)
|
||||||
checkStringFormat(stacktrace[it])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user