-
Notifications
You must be signed in to change notification settings - Fork 822
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
Generate UI Test Target Attributes #221
Generate UI Test Target Attributes #221
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @anreitersimon! 👏
This resolves #71
Would you mind adding a ui test target to the Test fixture https://github.com/yonaskolb/XcodeGen/blob/master/Tests/Fixtures/TestProject/spec.yml
and a unit test in https://github.com/yonaskolb/XcodeGen/blob/master/Tests/XcodeGenKitTests/ProjectGeneratorTests.swift under Targets
?
.flatMap { ref in self.proj.objects.buildConfigurations[ref] } | ||
|
||
return configs | ||
.flatMap { $0.buildSettings["TEST_TARGET_NAME"] as? String } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's interesting that this could change across configs. I wonder how Xcode deals with this. This is probably fine though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering about that too.
Xcode doesnt let you specify this on a per configuration basis.
Meaning it adds the TEST_TARGET_NAME
setting to all configurations.
and then (i assume) generates the target-attributes.
try expect(dependencies.count) == 1 | ||
try expect(dependencies.first!.target) == nativeTargets.first { $0.name == framework.name }!.reference | ||
try expect(dependencies.count) == 2 | ||
try expect(dependencies[0].target) == nativeTargets.first { $0.name == framework.name }!.reference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
relying on the order in which target target-dependencies are generated might not be very resilient.
I did not know how to fix this.
Actually "resolving" the dependencies and then asserting that they reference the correct target might be a better aproach.
It seems that iOS UITest targets generated with XCodeGen fail to run (tested with Xcode 9.2).
The
TargetApplication
Setting for the UITest target isn't configured correctly.Ive noticed toggling this setting in Xcode results in these diffs.
This appears to be some sort of look-up table for determining what target to test.
NT_493099431306
is the file-reference for the UITestTargetNT_791681633892
is the file-reference for the target matching the UITestTargetsTEST_TARGET_NAME
This PR adds generation of these target attributes