Skip to content

[XCTAssert] s/__FILE__/#file/g, s/__LINE__/#line/g #48

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

Merged
merged 1 commit into from
Feb 12, 2016

Conversation

modocache
Copy link
Contributor

"Screaming snake case" debugging identifiers like __FILE__ and __LINE__ are scheduled to be removed as per evolution proposal SE-0028. They were marked as deprecated in swiftlang/swift@0619e57#diff-b1b9777d77a07ee6e082cce7a2c52608R87.

Replace all uses of __FILE__ with #file, and __LINE__ with #line. This fixes compilation warnings emitted when building swift-corelibs-xctest with the latest version of Swift.

⚠️ Keep in mind that this means people using swift-corelibs-xctest must build the latest version of Swift from source (which includes the commit referenced above) in order to maintain compatibility. To run the tests on OS X, users must launch Xcode pointing to a toolchain built from the latest source.

"Screaming snake case" debugging identifiers like `__FILE__` and
`__LINE__` are scheduled to be removed as per evolution proposal
SE-0028 (https://github.com/apple/swift-evolution/blob/6e040b5d5d19df60329deffc125552a4cd63a21d/proposals/0028-modernizing-debug-identifiers.md).
They were marked as deprecated in swiftlang/swift@0619e57#diff-b1b9777d77a07ee6e082cce7a2c52608R87.

Replace all uses of `__FILE__` with `#file`, and `__LINE__` with
`#line`.

Keep in mind that this means people using swift-corelibs-xctest must
build the latest version of Swift from source (which includes the commit
referenced above) in order to maintain compatibility. To run the tests on
OS X, users must launch Xcode pointing to a toolchain built from the latest
source.
@mike-ferris
Copy link

Let me ask around here a bit about staging of the Swift change... We'll certainly take this eventually, but it may be that waiting a bit will be a bit more convenient.

@modocache
Copy link
Contributor Author

Sounds reasonable. Waiting for the next snapshot, which will include the new #file and #line, might be the best course of action. Users that encounter errors would simply have to update to the latest snapshot toolchain, rather than build from source.

@modocache
Copy link
Contributor Author

@mike-ferris-apple This can probably go in now that https://github.com/apple/swift/tree/swift-DEVELOPMENT-SNAPSHOT-2016-02-08 has been tagged. Users who encounter build errors should be encouraged to migrate to the latest snapshot.

@briancroom
Copy link
Contributor

@mike-ferris-apple @modocache agreed - this should be merged pretty soon now, as it needs to be included in the next snapshot, or else XCTest will fail to build.

parkera added a commit that referenced this pull request Feb 12, 2016
[XCTAssert] s/__FILE__/#file/g, s/__LINE__/#line/g
@parkera parkera merged commit 8934abb into swiftlang:master Feb 12, 2016
@parkera
Copy link
Contributor

parkera commented Feb 12, 2016

I'll go ahead and merge this.

@modocache modocache deleted the no-more-screaming-snake-case branch February 14, 2016 19:09
@modocache
Copy link
Contributor Author

Great, thanks!

modocache added a commit to modocache/swift that referenced this pull request Feb 19, 2016
Allow swift-corelibs-xctest to be built and tested on Linux and OS X,
via `utils/build-script --xctest --test`.

On OS X, XCTest is built via `xcodebuild`, which has been possible since
swiftlang/swift-corelibs-xctest#47. It's tested via
the "SwiftXCTestFunctionalTests" Xcode target. Keep in mind that
`xcodebuild` must be configured on the host machine to use a Swift
toolchain that can build XCTest--as of
swiftlang/swift-corelibs-xctest#48, that would be
`swift-DEVELOPMENT-SNAPSHOT-2016-02-08` or later.

On Linux, XCTest is built and tested via the project's
`build_script.py`, which has been possible since
swiftlang/swift-corelibs-xctest#46.
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.

4 participants