RunnerTestEnvironment

open class RunnerTestEnvironment(val projectCache: ProjectCache, val logger: ReportingLogger, val ruleFilter: RuleFilter, settings: (RunnerTestEnvironment) -> ModuleCheckSettings, codeGeneratorBindings: (ModuleCheckSettings) -> List<CodeGeneratorBinding>, rules: (ModuleCheckSettings, RuleFilter) -> List<ModuleCheckRule<*>>, findingFactory: (List<ModuleCheckRule<*>>) -> FindingFactory<out Finding>, names: List<String>, testLocation: TestLocation) : ProjectTestEnvironment(source)

Defines a test environment which uses a ModuleCheckRunner.

Parameters

settings

A function to generate ModuleCheckSettings.

codeGeneratorBindings

A function to generate a list of CodeGeneratorBinding.

rules

A function to generate a list of ModuleCheckRule.

findingFactory

A function to generate a FindingFactory.

names

Array of variant names for the test.

testLocation

details about the actual test function, so that we can get the test name. This must be grabbed as soon as possible, since default functions, inline functions, sequences, and iterators all redirect things and have a chance of hiding the original calling function completely.

Constructors

Link copied to clipboard
constructor(projectCache: ProjectCache, logger: ReportingLogger, ruleFilter: RuleFilter, settings: (RunnerTestEnvironment) -> ModuleCheckSettings, codeGeneratorBindings: (ModuleCheckSettings) -> List<CodeGeneratorBinding>, rules: (ModuleCheckSettings, RuleFilter) -> List<ModuleCheckRule<*>>, findingFactory: (List<ModuleCheckRule<*>>) -> FindingFactory<out Finding>, names: List<String>, testLocation: TestLocation)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A ReportingLogger for logging reporting events.

Link copied to clipboard
open override val projectCache: ProjectCache

An instance of ProjectCache.

Link copied to clipboard
Link copied to clipboard
open override val root: File
Link copied to clipboard

A RuleFilter for filtering out unwanted rules.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val workingDir: File

Functions

Link copied to clipboard
fun McProject.addDependency(configurationName: ConfigurationName, project: McProject, asTestFixture: Boolean)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun androidLibrary(path: String, androidPackage: String, config: McProjectBuilder<AndroidLibraryPluginBuilder>.() -> Unit): McProject
Link copied to clipboard
open fun androidTest(path: String, androidPackage: String, config: McProjectBuilder<AndroidTestPluginBuilder>.() -> Unit): McProject
Link copied to clipboard
Link copied to clipboard
open override fun String.cleanOutput(): String
Link copied to clipboard
fun McProject.createJavaFile(content: String, sourceSetName: SourceSetName): JavaFile
fun ProjectTestEnvironment.createJavaFile(content: String, project: McProject, sourceSetName: SourceSetName, jvmTarget: JvmTarget): JavaFile
Link copied to clipboard
fun ProjectTestEnvironment.createKotlinFile(content: String, project: McProject, sourceSetName: SourceSetName, jvmTarget: JvmTarget): KotlinFile
Link copied to clipboard
Link copied to clipboard
open operator fun File.invoke(text: () -> String)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Parses the log report into a list of pairs, each containing a report title and a list of ProjectFindingReport.

Link copied to clipboard
open suspend fun resolveReferences()
Link copied to clipboard
open infix fun <T, U : T> T.shouldBe(expected: U?)
open infix fun String.shouldBe(expected: String)
open infix fun Sequence<*>.shouldBe(expected: List<*>)
Link copied to clipboard
open infix fun String.shouldBeNoTrimIndent(expected: String)
Link copied to clipboard
open infix override fun File.shouldHaveText(expected: String)
Link copied to clipboard
open fun simpleProject(buildFileText: String?, path: String): McProject
Link copied to clipboard
open override fun tearDown()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun <T, U : T> T.trimmedShouldBe(expected: U?, vararg excludeFromStack: KClass<*>)
Link copied to clipboard