CompileTest

data class CompileTest

The compile test runner.

Compiles all sourcesFiles with the given processors (Annotation processors). Then checks all expectations.

When there are any errors an IllegalStateException is raised with text containing detailed information about all failed expectations.

See also

Types

Builder
Link copied to clipboard
class Builder
Builder for creating a CompileTest
Expectation
Link copied to clipboard
interface Expectation
Defines an expectation to be checked by a CompileTest
ExpectFileCount
Link copied to clipboard
data class ExpectFileCount(count: Int) : CompileTest.Expectation
Expectation that checks for the exact number of files to be created
ExpectFileToMatch
Link copied to clipboard
data class ExpectFileToMatch(file: String, expectedContent: String) : CompileTest.Expectation
Checks if the result has a generated file which matches the expectedContentThe content are not compared for pure equality.
ExpectFileToNotExist
Link copied to clipboard
data class ExpectFileToNotExist(file: String) : CompileTest.Expectation
Expectation that checks that the given file does NOT exist.

Functions

component1
Link copied to clipboard
operator fun component1(): List<Processor>
component2
Link copied to clipboard
operator fun component2(): List<SourceFile>
component3
Link copied to clipboard
operator fun component3(): List<CompileTest.Expectation>
copy
Link copied to clipboard
fun copy(processors: List<Processor>, sourcesFiles: List<SourceFile>, expectations: List<CompileTest.Expectation>): CompileTest
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open override fun hashCode(): Int
run
Link copied to clipboard
fun run(): KotlinCompilation.Result
Compiles and checks expectations
toString
Link copied to clipboard
open override fun toString(): String

Properties

expectations
Link copied to clipboard
val expectations: List<CompileTest.Expectation>
expectations to be checked
processors
Link copied to clipboard
val processors: List<Processor>
annotations processors to be used for compilation
sourcesFiles
Link copied to clipboard
val sourcesFiles: List<SourceFile>
source files to be compiled