Kotlin debugger tests
This module contains generated tests for Kotlin debugger.
Tests design lets one add debugger markup directly in a code sample.
For example, breakpoint installation is done with //Breakpoint! marker on the line previous to the target one.
Tests are separated into different categories depending on tested functionality, e.g. stepping, evaluation, smart-step-into targets, local variables, highlighting, etc.
To create a new test:
- Choose the target functionality to test and the corresponding subdirectory inside
testDatafolder - Create a
<FILE_NAME>.ktfile with the code sample to test - Add the markup specific for the target functionality. Check the available capabilities in the nearby files.
- Create a
<FILE_NAME>.outfile with the expected output. Check the expected output format in the nearby files. - Start
Generate Kotlin Tests (K1 + K2)run configuration
Markup
Stepping
//Breakpoint!installs a breakpoint to the next line. Breakpoint can be configured further:lambdaOrdinal=N-- breakpoint to theNth lambdalambdaOrdinal=-1-- basic line breakpoint (no suspension in lambdas)
condition=<EXPRESSION>-- conditional breakpoints- See all capabilities in BreakpointCreator.kt
- Stepping commands are executed on suspension points. The commands are executed in the order they appear in the file.
- Basic stepping commands can be called several times:
// <COMMAND>: NRESUME,STEP_INTO,STEP_OVER,STEP_OUT
- Smart step into
// SMART_STEP_INTO_BY_INDEX: Nsteps intoNth stepping target - See all commands in SteppingInstruction.kt
- Basic stepping commands can be called several times:
Evaluation
Evaluation commands are executed in the order they appear in the file.
- Expression to evaluate is stated via
// EXPRESSION: <EXPR>command - The expected results should follow the expression
// RESULT: <RES>: <TYPE> - See AbstractIrKotlinEvaluateExpressionTest.kt for details
Adding libraries to the classpath
Use // ATTACH_LIBRARY: maven(<LIB>) to add a library to the classpath.
For example, // ATTACH_LIBRARY: maven(org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4) adds coroutines
Multifile
Use // FILE: <FILE_NAME> directive to split a file into several files. You can use Kotlin or Java files.