Sharing test source set in KMP

Is there any approach to share common test code from a module among other modules’ test source sets in KMP? (Basically making some test source sets depend on a specific test source set)
I couldn’t find any solution applicable to KMP. I found test fixtures, but it seems to be a JVM-only solution.

So if you have source sets A and B, where A depends on B, do you want that executing A will also execute B?

What I want is to be able to make a utility class for testing inside module B, and be able to use that class within A which as you said depends on B. However, the use of implementation(project(":B")) inside A, only makes the main (non-test) sourceSet of A depend on the main sourceSet of B.

What I do is I create a normal module called ‘test’, then have my tests depend on it: utils.test · main · OpenSavvy / CLOVIS • Personal Information Tracker · GitLab

1 Like