Run with: ./gradlew run --args='scripts/script.test.kts' Notice that the stack trace source information is lost for the call inside the extension function.