Ugh.. I'm trying to add a new `JvmTestSuite` calle...
# gradle
e
Ugh.. I'm trying to add a new
JvmTestSuite
called B (and I already have one called A). B needs some of the code that exists in A, so I thought I would create a new Kotlin source set for the shared code and depend on it from both B and A, but I'm having trouble expressing this in gradle's Kotlin DSL..
I'm putting the shared code into a shared source set called
testUtils
, which is created as such:
Copy code
val testUtils by kotlin.sourceSets.creating {
   kotlin.srcDir("src/testUtils/kotlin")

   dependencies {
      // ....
   }
}
I tried adding it to the
JvmTestSuite
with:
Copy code
testing {
   suites {
      val integrationTest by registering(JvmTestSuite::class) {
         dependencies {
            implementation(sourceSets["testUtils"].output)
         }
      }
   }
}
but this gives a null pointer
a
Is the project a Kotlin/JVM project? If so, I recommend using java-test-fixtures to share test utilities instead of custom wiring of sources.
e
It is. Ill have a look at that, thanks 🙂
Turns out that created new issues due to the code shared between integration-testing suites caused unit-tests to fail due to classpath pollution...