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

[SR-1165] Swift 3 importer creates duplicate XCTest.run() methods #392

Closed
modocache mannequin opened this issue Apr 6, 2016 · 9 comments
Closed

[SR-1165] Swift 3 importer creates duplicate XCTest.run() methods #392

modocache mannequin opened this issue Apr 6, 2016 · 9 comments

Comments

@modocache
Copy link
Mannequin

modocache mannequin commented Apr 6, 2016

Previous ID SR-1165
Radar rdar://25780530
Original Reporter @modocache
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s XCTest
Labels Bug, ClangImporter, SDKOverlay, StarterBug, XCTest
Assignee @modocache
Priority Medium

md5: 86b338119b5fe40134e34b05d44c80d9

Issue Description:

I used swift-api-dump.py to generate XCTest.framework headers:

$ export SWIFT_BIN_DIR="/path/to/build/Ninja-ReleaseAssert/swift-macosx-x86_64/bin"
$ $SWIFT_BIN_DIR/swift-api-dump.py -s macosx -m XCTest \
    --framework-dir /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/

Using a recent commit of Swift (apple/swift@fc86f6e86ef5405756e0052e27dae1830e3d33bc), the importer generates two XCTestCase.run() definitions:

class XCTest : NSObject {
  // ...
  @available(*, deprecated)
  func run() -> XCTestRun
  func run()
}

These two should be disambiguated by being given different names. Alternatively, the deprecated run() method could be removed--although I'd expect you'd need to confirm with the Apple XCTest team that this is OK.

@belkadan
Copy link

belkadan commented Apr 6, 2016

cc @DougGregor

@DougGregor
Copy link
Member

This is something that can be fixed with swift_name.

@modocache
Copy link
Mannequin Author

modocache mannequin commented Apr 18, 2016

From what I understand that'll have to be added by the Apple XCTest team, correct? I don't think we can specify a name for that method from within the apple/swift XCTest SDK overlay.

I'll file a radar.

@modocache
Copy link
Mannequin Author

modocache mannequin commented Apr 18, 2016

Attached a radar link.

@modocache
Copy link
Mannequin Author

modocache mannequin commented May 16, 2016

Follow-up: this can be done by modifying the apinotes, see here: apple/swift#2434 (comment) In other words, any contributor should be able to take care of this fairly easily.

@modocache
Copy link
Mannequin Author

modocache mannequin commented May 23, 2016

Sent up a pull request: apple/swift#2645

@swift-ci
Copy link

Comment by Mike Ferris (JIRA)

This has been addressed in Xcode's XCTest via rdar://problem/25780530. We will be removing the deprecated method (it was deprecated a long time ago.)

@swift-ci
Copy link

Comment by Mike Ferris (JIRA)

Addressed via <rdar://problem/25780530> -[XCTest runTest] and -[XCTest run] generate duplicate method names in Swift 3 in Xcode's XCTest

@modocache
Copy link
Mannequin Author

modocache mannequin commented May 23, 2016

Awesome, thanks! I posted a follow-up question on apple/swift#2645 Once the API change is reflected on CI (maybe it already is?), we should clean up the tests a little (the execute() method should no longer be necessary). I might update/reopen this task to track that change.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 9, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants