TestGenerationBuilder

Properties

Link copied to clipboard
abstract val path: Path

The absolute test data directory for this group.

Link copied to clipboard
abstract val pathFromRoot: Path?

The relative path of this group's directory, from the test data root.

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
abstract fun configure(block: TestConfigurationBuilder.() -> Unit)

Apply compiler test framework configuration. Applies to this group's tests, and any descendents.

Link copied to clipboard

Apply test class generation configuration. Applies to this group's tests, and any descendents.

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

Override this to generate your tests.

Link copied to clipboard
abstract fun group(path: String? = null, inferPackageNames: Boolean = true, inferType: Boolean = true, block: TestGenerationBuilder.() -> Unit)

Create a sub-group.

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
abstract fun tests(testClassName: String? = null, customBaseClass: KClass<*>? = null, arguments: TestArguments = TestArguments())

Generate tests for all files in this group's directory and any sub-directories. Should only be used in leaf groups.

abstract fun tests(path: String, testClassName: String? = null, customBaseClass: KClass<*>? = null, arguments: TestArguments = TestArguments())

Generate tests for files in ./$path (from this group's directory) and any sub-directories. Should only be used in leaf groups.

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
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).