Tests for step out command

This commit is contained in:
Natalia Ukhorskaya
2015-05-19 15:41:13 +03:00
parent 5edc25d2ba
commit 95b9c05138
4 changed files with 20 additions and 0 deletions
@@ -610,6 +610,7 @@ fun main(args: Array<String>) {
model("debugger/tinyApp/src/stepInto/stepIntoAndSmartStepInto", testMethod = "doStepIntoTest", testClassName = "StepInto")
model("debugger/tinyApp/src/stepInto/stepIntoAndSmartStepInto", testMethod = "doSmartStepIntoTest", testClassName = "SmartStepInto")
model("debugger/tinyApp/src/stepInto/stepInto", testMethod = "doStepIntoTest", testClassName = "StepIntoOnly")
model("debugger/tinyApp/src/stepOut", testMethod = "doStepOutTest")
model("debugger/tinyApp/src/filters", testMethod = "doStepIntoTest")
}
@@ -46,6 +46,21 @@ public abstract class AbstractKotlinSteppingTest : KotlinDebuggerTestBase() {
finish()
}
protected fun doStepOutTest(path: String) {
val fileText = FileUtil.loadFile(File(path))
configureSettings(fileText)
createDebugProcess(path)
val count = findStringWithPrefixes(fileText, "// STEP_OUT: ")?.toInt() ?: 1
for (i in 1..count) {
onBreakpoint { stepOut() }
}
finish()
}
protected fun doSmartStepIntoTest(path: String) {
createDebugProcess(path)
onBreakpoint { smartStepInto() }
@@ -115,6 +115,10 @@ abstract class KotlinDebuggerTestBase : KotlinDebuggerTestCase() {
dp.getManagerThread()!!.schedule(dp.createStepIntoCommand(this, ignoreFilters, smartStepFilter))
}
protected fun SuspendContextImpl.stepOut() {
dp.getManagerThread()!!.schedule(dp.createStepOutCommand(this))
}
protected fun SuspendContextImpl.printContext() {
runReadAction {
if (this.getFrameProxy() == null) {