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-710][Index] isTestCandidate access for Linux #2518

Conversation

modocache
Copy link
Contributor

@modocache modocache commented May 13, 2016

What's in this pull request?

The goal for https://bugs.swift.org/browse/SR-710 is to automatically generate a list of tests to run for XCTest on Linux. The prevailing approach is to generate this list using SourceKit, which is to be ported to Linux.

SourceKit uses libIndex's concept of isTestCandidate to determine what constitutes a test. isTestCandidate is tested via test/SourceKit/Indexing/index.swift.

On Linux, however, the list of tests to be run will be generated by some tool and placed in a file that is separate from the source file that defines the test method. Therefore, the test method must not be "private", since it needs to be accessed from a separate file.

This commit adds two test files: one that verifies the behavior on Linux, and one that verifies the behavior on platforms with Objective-C interop. It also (1) simplifies the isTestCandidate function, and (2) adds the interop-specific logic.

This commit does not remove the existing isTestCandidate tests in test/SourceKit/Indexing/index.swift; that is left for a future commit.

Resolved Related bug number: (SR-710)


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
OS X platform @swift-ci Please test OS X platform
Linux platform @swift-ci Please test Linux platform

Note: Only members of the Apple organization can trigger swift-ci.

The goal for https://bugs.swift.org/browse/SR-710 is to automatically
generate a list of tests to run for XCTest on Linux. The prevailing
approach is to generate this list using SourceKit, which is to be
ported to Linux.

SourceKit uses libIndex's concept of `isTestCandidate` to determine
what constitutes a test. `isTestCandidate` is tested via
`test/SourceKit/Indexing/index.swift`.

On Linux, however, the list of tests to be run will be generated by
some tool and placed in a file that is separate from the source file
that defines the test method. Therefore, the test method must not be
"private", since it needs to be accessed from a separate file.

This commit adds two test files: one that verifies the behavior on
Linux, and one that verifies the behavior on platforms with Objective-C
interop. It also (1) simplifies the `isTestCandidate` function, and (2)
adds the interop-specific logic.

This commit does not remove the existing `isTestCandidate` tests in
`test/SourceKit/Indexing/index.swift`; that is left for a future commit.
@modocache
Copy link
Contributor Author

@swift-ci please test

@modocache
Copy link
Contributor Author

The failing test on OS X, Reflection/existentials.swift, is unrelated.

@akyrtzi, care to take a look at this?

@briancroom
Copy link
Contributor

@swift-ci Please test OS X platform

@modocache
Copy link
Contributor Author

Thanks for pinging this, @briancroom. I still think it's something we should merge. @akyrtzi, @benlangmuir, any thoughts here?

@benlangmuir
Copy link
Contributor

LGTM

@modocache modocache merged commit 73202fc into swiftlang:master Jun 3, 2016
@modocache modocache deleted the sourcekit-is-test-candidate-accessibility branch June 3, 2016 18:50
@modocache
Copy link
Contributor Author

Great, thanks! 💯

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

Successfully merging this pull request may close these issues.

3 participants