Open dalewking opened 4 years ago
Thanks for bringing this one up. So far I did not get any feedback that people would like to use Atrium for iOS or another native platform. I will look into it once I have a use case myself (none in the outlook so far though). Please react with :+1: if you would like to see this implemented as well - this might motivate me to look into it even before I have a use case myself -- feel free to sponsor me, that would be a motivation too. And of course, your help would be appreciated.
Please update this with native support. It's a great framework and it really sucks not having the ability to run tests on native.
@Sxtanna thanks for the feedback. In case you have time and would like to contribute, we first need to migrate Atrium to the new MPP plugin in order to be able to provide native targets.
@robstoll I am actually using this in my first ever mpp project, so I'm not too versed in all norms.
But I would be more than happy to prototype migration efforts. I'll give it a try.
@Sxtanna great, I suggest you have a look at https://github.com/robstoll/atrium/issues/744 first. I'll try to help you so that you can do already some part of the migration. Migrating everything at once will probably a bit too much to start with. I'll see how we can do it best and come back to you again.
Alternatively, kotest already has a nice assertion library that supports MPP.
@Sxtanna MPP migration is done. would you like to add further platforms?
@robstoll is iOS/native support available now?
No not yet, do you fancy to contribute it?
Love to. What would that entail?
I see the following things which need to be done for each target platform. I suggest you start only with one of the tier 1 platforms. We can add more later: https://kotlinlang.org/docs/native-target-support.html
js
=> https://github.com/robstoll/atrium/blob/main/build.gradle.kts#L137 (see https://kotlinlang.org/docs/multiplatform-set-up-targets.html for help)expect
definitions (I think we only have them in atrium-core) => take a look at JS we have sometimes defined reasonable defaults and I think in some cases we even throw an UnsupportedOperation (so far we never had complaints so I guess those features are not used by JS users)
2b. in case Spek does not support your native target, then you will have to provide a few dummy implementations so that it compiles in the end => see misc/atrium-specs/src/jsMain/kotlin/io.mockk/mock.kt as a guidance, Mockk does not support js and we just faked it for JS to make it run (spek also doesn't support JS)./gradlew :atrium-api-fluent-en_GB:xyTest
where you need to replace xy with your platform name => we want to be sure that the samples are run for the new platform. This way we have at least a minimal test set in case Spek does not support the native target../gradlew :atrium-api-fluent-en_GB:xyTest
to see if it also fails for your native targetI hope this gives you good pointers to start. Maybe also take a look at https://github.com/robstoll/atrium/blob/main/.github/CONTRIBUTING.md#your-first-code-contribution
And in case you get stuck somewhere, create a draft PR and I'll try to help.
Platform: iOS
Non-Code related feature
Unfortunately, I have to abandon Atrium because of the lack of support for Kotlin native for iOS. Kotlin multiplatform does not just mean Java and Javascript