[tests] makes check_stacktrace_format enabled again

This commit is contained in:
Vasily Levchenko
2019-05-22 12:42:31 +03:00
parent 4ee31d139d
commit 479c91d880
2 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -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])
}
}
} }
} }