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-276] Starter bug: Run swift-corelibs-foundation tests against Darwin Foundation #4202

Closed
parkera opened this issue Dec 17, 2015 · 7 comments

Comments

@parkera
Copy link
Member

parkera commented Dec 17, 2015

Previous ID SR-276
Radar None
Original Reporter @parkera
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 1
Component/s Foundation
Labels Bug, StarterBug
Assignee @spevans
Priority Medium

md5: c39b051e616bf6be9dc8b35f65abc46e

Issue Description:

One of our important goals for the Swift Core Libraries is cross-platform compatibility.

A great way to verify that the compatibility is actually there is to run the great test suite that everyone has been contributing to, but against the OS X version of Foundation instead.

Any differences in behavior between Swift Foundation and Darwin Foundation can be considered a bug, to resolve in some way.

This means we need to add a target to the Xcode project which uses the Swift XCTest but system Foundation.

@hartbit
Copy link
Collaborator

hartbit commented May 23, 2016

What's the status on this? How is this task linked to moving swift-corelibs-foundation to swiftpm?

@swift-ci
Copy link
Contributor

Comment by Ian Ynda-Hummel (JIRA)

I was literally coming back to this today. I don't immediately see a connection to spm.

@hartbit
Copy link
Collaborator

hartbit commented May 23, 2016

The connection I see is that it might be easier to support one single way to run unit tests on all platforms with SwiftPM.

Different thought: the fact that we still have to `bridge()` standard library value types means that quite a few tests that use that temporary method will not compile under Darwin Foundation. Perhaps we could provide a dummy bridge function for that platform.

@swift-ci
Copy link
Contributor

Comment by Ian Ynda-Hummel (JIRA)

Yeah. I remember having to create an extension that defines them manually.

That said, the problem I'm actually running into right now is that I am having trouble getting a new target to not pick up CoreFoundation headers from multiple places. It seems that linking OS X's Foundation is just conflicting a bunch with heads being pulled in from... somewhere for Swift Foundation's version of CF.

@swift-ci
Copy link
Contributor

Comment by Ian Ynda-Hummel (JIRA)

I feel like I'm going a little crazy. It seems like the Foundation that ships with the current Xcode beta is incompatible with the current swift toolchain. I've tried the current preview in the Xcode beta and a couple of the nightlies from swiftnightly.com. It seems to stem from the use of

@swift-ci
Copy link
Contributor

Comment by Ian Ynda-Hummel (JIRA)

Using the newest official snapshot it still fails to build the CoreFoundation module:

/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h:14:39: Expected ';' after top level declarator

@spevans
Copy link
Collaborator

spevans commented Apr 24, 2019

There is now a DarwinCompatibilityTests Xcode project in the swift-corelibs-foundation repository that builds the tests against native Foundation. Whilst many of the tests still fail this does allow the tests to be run using Xcode's XCTest runner.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 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

4 participants