BaseTestGenerator

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

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open val additionalMethods: List<MethodGenerator<*>>

Additional methods to add to generated test classes.

Link copied to clipboard
open val boxOptIns: Set<String>

Opt-ins to add to all test data files as box tests, via a preprocessor.

Link copied to clipboard
open val cleanGeneratedRoot: Boolean = true

Whether to clean the root of the generated tests before generating. Defaults to true.

Link copied to clipboard
open val compilerPluginRegistrar: CompilerPluginRegistrar?

A CompilerPluginRegistrar to register the compiler plugin. Defaults to the plugin registrar specified in the Gradle plugin.

Link copied to clipboard

Whether to disable autogeneration. Defaults to false. If true, override generateTests or else no tests will be generated.

Link copied to clipboard
open val imports: Set<String>

Imports to add to all test data files, via a preprocessor.

Link copied to clipboard
open val optIns: Set<String>

Opt-ins to add to all test data files, via a preprocessor.

Link copied to clipboard
open val testDataRoot: Path

The root of the test data. Autoconfigured by the Gradle plugin.

Link copied to clipboard

The root of the generated tests. Autoconfigured by the Gradle plugin.

Link copied to clipboard

The package name of the generated tests. Defaults to the package of the test generator.

Functions

Link copied to clipboard
open fun adjustCompilerConfiguration(module: TestModule, configuration: CompilerConfiguration)

Called to adjust the compiler configuration before tests are run.

Link copied to clipboard
override fun configureTest(testInstance: AbstractKotlinCompilerTest, builder: TestConfigurationBuilder)
Link copied to clipboard
open fun coreConfiguration(builder: TestConfigurationBuilder)

The core configuration used to set up the other options in this class. Override at your own risk. If you do not call super things will not work as expected.

Link copied to clipboard
open fun defaultConfiguration(builder: TestConfigurationBuilder)

The default configuration applied to all tests. Override at your own risk, but not suite as dangerous as coreConfiguration.

Link copied to clipboard

Override this to generate your tests.