From 479c91d8802294bf599dfc23c8ff155453ad57e8 Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Wed, 22 May 2019 12:42:31 +0300 Subject: [PATCH] [tests] makes check_stacktrace_format enabled again --- backend.native/tests/build.gradle | 2 +- .../tests/runtime/exceptions/check_stacktrace_format.kt | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/backend.native/tests/build.gradle b/backend.native/tests/build.gradle index 4fb0f42ee2e..eeab4eb1fdc 100644 --- a/backend.native/tests/build.gradle +++ b/backend.native/tests/build.gradle @@ -2081,7 +2081,7 @@ task extend_exception(type: RunKonanTest) { } task check_stacktrace_format(type: RunStandaloneKonanTest) { - disabled = true // !isAppleTarget(project) + disabled = !isAppleTarget(project) || project.globalTestArgs.contains('-opt') flags = ['-g'] source = "runtime/exceptions/check_stacktrace_format.kt" } diff --git a/backend.native/tests/runtime/exceptions/check_stacktrace_format.kt b/backend.native/tests/runtime/exceptions/check_stacktrace_format.kt index 8fde9f81158..2f21dc84d64 100644 --- a/backend.native/tests/runtime/exceptions/check_stacktrace_format.kt +++ b/backend.native/tests/runtime/exceptions/check_stacktrace_format.kt @@ -29,15 +29,14 @@ fun functionB() { functionA() } +const val depth = 5 + fun main(args : Array) { try { functionB() } catch (e: Throwable) { val stacktrace = e.getStackTrace() - if (stacktrace.size >= 3) { - repeat(3) { - checkStringFormat(stacktrace[it]) - } - } + assert(stacktrace.size >= depth) + stacktrace.take(depth).forEach(::checkStringFormat) } }