Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working with multiple test targets for different platforms (iOS|tvOS) #523

Open
DominatorVbN opened this issue Nov 12, 2024 · 1 comment

Comments

@DominatorVbN
Copy link

I am facing a issue where one single project is hosting two target one for iOS and one for AppleTV,

Both have respective test targets i.e. (MyiOSTests, MyTvOSTests), in both of them the set of files i want to mock are different and the set of testable imports i want to have are different.

I have tried two variants of config toml

first assuming the later part to the module. is a xcode test target which is being built.

[modules.MyiOSTests]
imports = ["Foundation"]
testableImports = ["MyiOS"]
sources = [...]

[modules.MyTvOSTests]
imports = ["Foundation"]
testableImports = ["MyTvOS"]
sources = [...]

second assuming the later part to the module. is a xcode target which is being built.

[modules.MyiOS]
imports = ["Foundation"]
testableImports = ["MyiOS"]
sources = [...]

[modules.MyTvOS]
imports = ["Foundation"]
testableImports = ["MyTvOS"]
sources = [...]

I feel the later part to module. but in that case how can i set testableImports differently for both the test targets ?

Project Name: My.xcodeproj
iOS Target Name: MyiOS
iOS Test Target Name: MyiOSTests
tvOS Target Name: MyTvOS
tvOS Test Target Name: MyTvOSTests

@MatyasKriz
Copy link
Collaborator

Hey, the name after modules. is entirely custom, it doesn't determine anything and is only used for reference inside the Cuckoofile.

What you want to do is define your modules like so:

[modules.AppNameiOS]
# ...

[modules.AppNameiOS.xcodeproj]
target = "MyiOS"


[modules.AppNameTvOS]
# ...

[modules.AppNameTvOS.xcodeproj]
target = "MyTvOS"

Though I think your second solution should work just as well, only defining the import and sources manually, I don't really understand what's wrong with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants