Hello! I have a question (could be dumb), I'm gene...
# ksp
n
Hello! I have a question (could be dumb), I'm generating unit test files/classes with KSP. I wanted to ask if there is any way that the unit test classes are created/generated in the
src/test/kotlin
directory? right now they are generated in the default ksp-generated directory. I could think of writing a Gradle task for moving them to the appropriate directory after processing/generating them with Ksp. Is there any other better way?
e
g
Do you want to test your generated code or do you want to run the tests you've generated?
m
If you simply want to generate output directly into the test directory, you can use kspTest as per https://kotlinlang.org/docs/ksp-multiplatform.html
If you want to test what your ksp processor generates does what it is supposed to do, my approach is to have a test module (which has processed annotations and uses the KSP module) and then use unit tests to make sure that the generated code does what it is supposed to end-to-end.
n
Ah yes! Got it! Thanks a lot, everyone! I will check that 👍