-
Notifications
You must be signed in to change notification settings - Fork 1.2k
DarwinComptibilityTests: Add Xcode Project #1286
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
DarwinComptibilityTests: Add Xcode Project #1286
Conversation
576bad3
to
20035f9
Compare
Great! This should really help with compatibility. |
20035f9
to
187a351
Compare
@swift-ci please test |
a304027
to
53ffe2c
Compare
- Add shims and minor test fixes. - Disable XDG tests as the xdgTestHelper does not currently work. - Add handling for some tests requiring macOS 10.13 that run on 10.12 when run against the sclf version of Foundation. This requires some of the tests to be duplicated and wrapped inside of a DARWIN_COMPATIBILITY_TEST conditional compile.
53ffe2c
to
c4aad6e
Compare
@swift-ci please test |
I think this is ready for comments/merging now. If someone could test it locally on 10.13 that would be useful as I currently only run 10.12 |
What else is remaining for this to be integrated into CI? |
@swift-ci please test |
Fixing the tests will be an ongoing effort and shouldn't prevent this being used for CI in some form. Simply compiling the tests against the native Foundation finds issues where the methods and therefore the tests have been implemented with the incorrect function signatures. I have fixed up all of the current issues in previous PRs so we should be able to proceed with a CI job that invokes an Xcode build of the tests but doesn't run them. Im not actually sure how to use I would suggest this being triggered as a manual job for now until we have confidence in how it works e.g., using As to the broken tests they mainly fall into the following groups:
|
@alblue Do you have any thoughts on this? |
I see a couple of crashes when running it against a newer version, including But I think we should migrate this in and then figure out how to fix these things incrementally to get to a clean bill of health. The only comment I have is that the Also, in the sections where you have defined the macro |
- Move DarwinShims.swift into DarwinCompatibilityTests subdir. - Disable more tests that crash on Darwin native. - Use DEPLOYMENT_RUNTIME_OBJC instead of DARWIN_COMPATIBILITY_TESTS to disable a deallocate() that isnt needed for AutoReleasing objects.
@alblue I fixed the issues you identified. |
@swift-ci please test |
@swift-ci please test |
@swift-ci please test and merge |
This PR adds a new Xcode Project
DarwinCompatibiltyTests
that compiles the currentswift-corelibs-foundation
tests against the native Foundation and XCTest. This allows tests to be validated against the native Foundation and is useful for checking edge cases especially for types such asNSNumber
,Decimal
etc. The tests show up as unit tests in Xcode so can be run individually.All of the tests currently compile, with the help of some compatibility shims, however some of the tests fail. Tests that hang or crash are commented out using the
#if !DARWIN_COMPATIBILTY_TESTS/#endif
pair which is defined in the project's compiler flags.On 10.12 about 100 tests (185 individual
XCTAsserts
) currently fail for various reasons. Also some methods require 10.13 etc (currently usingif #available()
but this isn't a permanent solution).The
xdgTestHelper
is also not currently compiled and is disabled in the tests as I could not find the cookie storage location, but this can be fixed in the future.This has been tested on 10.12 (Sierra) but not 10.13 (High Sierra). I won't fix all of the tests before this is merged as there will be too many to fix upfront and some may also pass on 10.13 but not 10.12, however it is envisaged that tests will be fixed on an ongoing basis.
Any comments, suggestions welcome.
DarwinCompatibilityTests
DARWIN_COMPATIBILITY_TESTS
flag.