From 405fa3c8581d7129f67b8cd57cec058d612d9fa9 Mon Sep 17 00:00:00 2001 From: IlyaMuravjov Date: Mon, 13 Mar 2023 17:28:28 +0300 Subject: [PATCH] Make default implementation of expectTimeout generate tested method call --- .../codegen/services/framework/TestFrameworkManager.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/services/framework/TestFrameworkManager.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/services/framework/TestFrameworkManager.kt index 964781e801..6265889474 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/services/framework/TestFrameworkManager.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/services/framework/TestFrameworkManager.kt @@ -203,7 +203,14 @@ abstract class TestFrameworkManager(val context: CgContext) abstract fun passArgumentsToArgsVariable(argsVariable: CgVariable, argsArray: CgVariable, executionIndex: Int) - open fun expectTimeout(timeoutMs: Long, block: () -> Unit) {} + /** + * Most frameworks don't have special timeout assertion, so only tested + * method call is generated, while timeout is set using + * [timeout argument][timeoutArgumentName] of the test annotation + * + * @see setTestExecutionTimeout + */ + open fun expectTimeout(timeoutMs: Long, block: () -> Unit): Unit = block() open fun setTestExecutionTimeout(timeoutMs: Long) { val timeout = CgNamedAnnotationArgument(