-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Centralise test imports and add os(Android) #1528
Conversation
@swift-ci please test |
TestFoundation/main.swift
Outdated
|
||
#if os(macOS) || os(iOS) | ||
import Darwin | ||
#elseif os(Linux) | ||
#elseif os(Linux) || os(Android) | ||
import Glibc | ||
#endif | ||
|
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.
Is it worth simplifying this to:
#if canImport(Darwin)
import Darwin
#elseif canImport(Glibc)
import (Glibc)
#endif
(and also in HTTPServer.swift
)
The test failure should be fixed now. |
There was a failure but it was fixed before I found this out:
|
@swift-ci please test |
Sorry @alblue you might need to start the test again. I had to amend the XDG changes so Linux works. |
@swift-ci please test |
@johnno1962 can you also confirm this works when running the tests in Xcode on Darwin? |
I wish I could but I’m still running Xcode 9.3 and can’t get past Foundation. Downloading the beta now.. |
@johnno1962 Make sure you're using a current Swift compiler toolchain (either built with ninja, or via a swift.org snapshot.) |
@swift-ci please test |
I’m up to date using master from swift.org now. I’m seeing a seemingly unrelated crash on macOS here: https://github.com/apple/swift-corelibs-foundation/blob/master/CoreFoundation/String.subproj/CFStringEncodings.c#L639 |
@johnno1962 See #1498 for details of that crash. |
Thanks @spevans It’s a strange crash, a buffer overrun that always crashes at the same place. Anyways, I think this is good to go now. Sorry about the XDG problems. Can I ask, what is XDG? |
@swift-ci please test and merge |
Thanks @millenomi |
Hi Apple,
This PR adds os(Android) to the conditional imports and centralises them to reduce some boilerplate.