Dokka is meant to be used to document source code of libraries, to provide documentation to publish about how your API works. The test
source set is supposed to contain unit tests for testing the library code, and not neccesarily to also document the library; that's the job of the library itself, the main
source set. Sample functions (https://kotlinlang.org/docs/kotlin-doc.html#sample-identifier) would generate documentation, though. Alternatively, you can configure dokka to consider the test
source set as source code, and not testing code:
tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets {
named("test") {
sourceRoots.from(file("src/test/"))
}
}
}
See also: https://kotlinlang.org/docs/dokka-gradle.html#source-set-configuration