Package-level declarations

The test generation DSL.

Types

Link copied to clipboard

A test generator that only does auto-generation.

Link copied to clipboard

A test generator. Configures test generation, and can override generateTests to generate tests using the DSL.

Link copied to clipboard
data class TestArguments(val recursive: Boolean = true, val excludeParentDirs: Boolean = false, val extension: String? = "kt", val pattern: String = if (extension == null) """^([^\.]+)$""" else "^(.+)\\.$extension\$", val excludedPattern: String? = null, val testMethod: String = "doTest", val singleClass: Boolean = false, val targetBackend: TargetBackend? = null, val excludeDirs: List<String> = listOf(), val excludeDirsRecursively: List<String> = listOf(), val filenameStartsLowerCase: Boolean? = null, val skipIgnored: Boolean = false, val deep: Int? = null, val skipSpecificFile: (File) -> Boolean = { false }, val skipTestAllFilesCheck: Boolean = false, val generateEmptyTestClasses: Boolean = true, val nativeTestInNonNativeTestInfra: Boolean = false)

Test arguments to pass to the underlying Kotlin compiler plugin test framework test generator. See org.jetbrains.kotlin.generators.TestGroup.TestClass.model for details.

Link copied to clipboard

A utility object used to invoke test generation.

Link copied to clipboard
Link copied to clipboard

Configuration options for the test class generator.

Link copied to clipboard

Functions

Link copied to clipboard

Add a test level to this group, and any descendents.

Link copied to clipboard
fun TestGenerationBuilder.annotation(annotation: AnnotationModel)

Add test class annotations to this group, and any descendents.

Link copied to clipboard

Auto-generate tests for this group, inferring test types from directory names.

Link copied to clipboard
fun TestGenerationBuilder.directives(vararg containers: DirectivesContainer, block: RegisteredDirectivesBuilder.() -> Unit)

Register directive containers and configure directives for this group, and any descendents.

Link copied to clipboard
fun TestGenerationBuilder.group(path: String? = null, type: TestType, block: TestGenerationBuilder.() -> Unit)

Create a group with the given test type.

fun TestGenerationBuilder.group(path: String? = null, vararg levels: TestLevel, block: TestGenerationBuilder.() -> Unit)

Create a group with the given levels.

Link copied to clipboard
fun TestGenerationBuilder.import(vararg imports: String)
fun TestGenerationBuilder.import(vararg imports: KClass<*>)

Add imports to this group's tests, and any descendents.

Link copied to clipboard
fun TestGenerationBuilder.method(method: MethodModel)

Add test class methods to this group, and any descendents.

Link copied to clipboard
fun TestGenerationBuilder.optIn(vararg optIns: String)
fun TestGenerationBuilder.optIn(vararg optIns: KClass<*>)

Add opt-in annotations to this group's tests, and any descendents.

Link copied to clipboard
fun TestGenerationBuilder.optInBox(vararg optIns: KClass<*>)

Add opt-in annotations to the box() functions in this group's tests, and any descendents.

Link copied to clipboard
fun TestGenerationBuilder.registerDirectives(vararg containers: DirectivesContainer)

Register directive containers for this group, and any descendents.

Link copied to clipboard

Remove a test level from this group, and any descendents.

Link copied to clipboard
fun TestGenerationBuilder.testsPackage(vararg packageNames: String)

Add a to the package name of test classes generated by this group and any descendents..

Link copied to clipboard
context(generator: TestGenerationBuilder)
operator fun TestLevel.unaryMinus()

Remove a test level from this group, and any descendents.

context(generator: TestGenerationBuilder)
operator fun TestSpec.unaryMinus()

Remove test levels from this group, and any descendents.

Link copied to clipboard
context(generator: TestGenerationBuilder)
operator fun TestType.unaryPlus()

Add a test type to this group, and any descendents.

context(generator: TestGenerationBuilder)
operator fun TestLevel.unaryPlus()

Add a test level to this group, and any descendents.

context(generator: TestGenerationBuilder)
operator fun TestSpec.unaryPlus()

Add test levels to this group, and any descendents.

Link copied to clipboard
fun TestGenerationBuilder.withCompilerConfiguration(configurator: CompilerConfiguration.(TestModule) -> Unit)

Apply compiler configuration to this group, and any descendents.

Link copied to clipboard

Use the specified spec for the corresponding pluginRegistrar for this group, and any descendents (unless overridden).