[swift-evolution] [Draft] Introducing Build Configuration Tests for Platform Conditions

William Dillon william at housedillon.com
Tue Mar 15 11:17:03 CDT 2016


These are excellent.  I wouldn’t have chosen anything differently.

Thanks, Erica!

> On Mar 15, 2016, at 9:10 AM, Erica Sadun via swift-evolution <swift-evolution at swift.org> wrote:
> 
> https://gist.github.com/erica/5a344b12bd989f6395c2 <https://gist.github.com/erica/5a344b12bd989f6395c2>
> 
> I think this one is pretty straightforward, but as always feedback is requested and appreciated. 
> Let me know if you're okay with the names and the approach and whether there are any technical
> barriers that need addressing.
> 
> Thanks, -- E
> 
> Introducing Build Configuration Tests for Platform Conditions
> 
> Proposal: SE-00XX
> Author(s): Erica Sadun <http://github.com/erica>
> Status: TBD
> Review manager: TBD
>  <https://gist.github.com/erica/5a344b12bd989f6395c2#introduction>Introduction
> 
> This proposal introduces configuration test to differentiate platform conditions.
> 
> This proposal was discussed on-list in the Introducing Build Configuration Tests for Platform Conditions <applewebdata://16D657C7-581A-4F1A-9FCC-5C777E259D40>.
> 
>  <https://gist.github.com/erica/5a344b12bd989f6395c2#motivation>Motivation
> 
> Testing for platform conditions is a typical developer task. Although some built-in features like CFByteOrderGetCurrentexist, it seems a natural match to Swift to introduce build configurations specific to common platform conditions.
> 
>  <https://gist.github.com/erica/5a344b12bd989f6395c2#detail-design>Detail Design
> 
> This proposal adds the following build configuration tests:
> 
> #if endian(big)
> #if endian(little)
> #if bitwidth(32)
> #if bitwidth(64)
>  <https://gist.github.com/erica/5a344b12bd989f6395c2#current-art>Current Art
> 
> Swift currently supports the following configuration tests:
> 
> The literals true and false
> The os() function that tests for OSX, iOS, watchOS, tvOS, Linux, Windows, and FreeBSD
> The arch() function that tests for x86_64, arm, arm64, i386, powerpc64, and powerpc64le
> The swift() function that tests for specific Swift language releases, e.g. swift(>=2.2)
>  <https://gist.github.com/erica/5a344b12bd989f6395c2#alternatives-considered>Alternatives Considered
> 
> There are no alternatives considered.
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160315/f1bcf3d0/attachment-0001.html>


More information about the swift-evolution mailing list