Skip to content

Update APIs to match some tweaking for Swift3 in Xcode's XCTest. #98

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
Apr 16, 2016
Merged

Update APIs to match some tweaking for Swift3 in Xcode's XCTest. #98

merged 1 commit into from
Apr 16, 2016

Conversation

mike-ferris
Copy link

This pull request changes 1 API (XCTestSuiteRun's addTest() method, changing it to addTestRun()) to match a similar change that is being made in Xcode's XCTest for Swift 3.

In this particular case, the importer just got it wrong. The Objective-C selector is addTestRun:. Until Xcode ships for Swift 3, this will be an inconsistency in the API, but this is a more or less never used API outside the implementation of XCTest.

@mike-ferris
Copy link
Author

@swift-ci please test

@modocache
Copy link
Contributor

modocache commented Apr 16, 2016

Hmm, looks like a legitimate build error on OS X:

CompileSwift normal x86_64 /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSData.swift
    cd /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation
    /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/Ninja-DebugAssert/swift-macosx-x86_64/bin/swift -frontend -c /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSArray.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSEnergyFormatter.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSURLError.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSPersonNameComponentsFormatter.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSCompoundPredicate.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/FoundationErrors.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSXMLDTDNode.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSNull.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSURLProtectionSpace.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSEnumerator.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSTimer.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSXMLParser.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSCFSet.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSComparisonPredicate.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSCache.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSOperation.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSExpression.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSPort.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSTextCheckingResult.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSTimeZone.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSDateComponentsFormatter.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSURLCredential.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSXMLElement.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSJSONSerialization.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSString.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSURLSession.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSRange.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSAttributedString.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSSwiftRuntime.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSFileHandle.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSPredicate.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSUUID.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSXMLNode.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSLocale.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSKeyedArchiver.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSError.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSSortDescriptor.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSBundle.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSSpecialValue.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSPortMessage.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSURLAuthenticationChallenge.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSIndexSet.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSDate.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSValue.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSFormatter.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSFileManager.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSCharacterSet.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSStream.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSURL.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSThread.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSConcreteValue.swift -primary-file /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSData.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSScanner.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSIndexPath.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSPathUtilities.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSURLRequest.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSGeometry.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSDateFormatter.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSProcessInfo.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSRegularExpression.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSLengthFormatter.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSCFArray.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSProgress.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSDateIntervalFormatter.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSCalendar.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSTask.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSObjCRuntime.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/String.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSDictionary.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSNumberFormatter.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSKeyedUnarchiver.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSHost.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSAffineTransform.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSXMLDocument.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSCFDictionary.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSNotificationQueue.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSDecimalNumber.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSCoder.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSKeyedCoderOldStyleArray.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSNotification.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSObject.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSByteCountFormatter.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSURLProtocol.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSLog.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSRunLoop.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSXMLDTD.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSMassFormatter.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSXMLNodeOptions.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSNumber.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSURLCache.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSUserDefaults.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSLock.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSSet.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSHTTPCookie.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSCFString.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSOrderedSet.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSURLResponse.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSDecimal.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSHTTPCookieStorage.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSURLCredentialStorage.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSPropertyList.swift /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSPersonNameComponents.swift -target x86_64-apple-macosx10.11 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -I /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/Ninja-DebugAssert/xctest-macosx-x86_64/Debug -F /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/Ninja-DebugAssert/xctest-macosx-x86_64/Debug -enable-testing -g -import-underlying-module -module-cache-path /Users/buildnode/Library/Developer/Xcode/DerivedData/ModuleCache -serialize-debugging-options -Xcc -iquote -Xcc /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/Ninja-DebugAssert/xctest-macosx-x86_64/Foundation.build/Debug/SwiftFoundation.build/SwiftFoundation-generated-files.hmap -Xcc -I/Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/Ninja-DebugAssert/xctest-macosx-x86_64/Foundation.build/Debug/SwiftFoundation.build/SwiftFoundation-own-target-headers.hmap -Xcc -I/Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/Ninja-DebugAssert/xctest-macosx-x86_64/Foundation.build/Debug/SwiftFoundation.build/SwiftFoundation-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/Ninja-DebugAssert/xctest-macosx-x86_64/Foundation.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/Ninja-DebugAssert/xctest-macosx-x86_64/Foundation.build/Debug/SwiftFoundation.build/SwiftFoundation-project-headers.hmap -Xcc -I/Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/Ninja-DebugAssert/xctest-macosx-x86_64/Debug/include -Xcc -I/Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/Ninja-DebugAssert/xctest-macosx-x86_64/Debug/usr/local/include -Xcc -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 -Xcc -I/Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/Ninja-DebugAssert/xctest-macosx-x86_64/Foundation.build/Debug/SwiftFoundation.build/DerivedSources/x86_64 -Xcc -I/Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/Ninja-DebugAssert/xctest-macosx-x86_64/Foundation.build/Debug/SwiftFoundation.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -working-directory/Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation -emit-module-doc-path /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/Ninja-DebugAssert/xctest-macosx-x86_64/Foundation.build/Debug/SwiftFoundation.build/Objects-normal/x86_64/NSData~partial.swiftdoc -Onone -module-name SwiftFoundation -emit-module-path /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/Ninja-DebugAssert/xctest-macosx-x86_64/Foundation.build/Debug/SwiftFoundation.build/Objects-normal/x86_64/NSData~partial.swiftmodule -serialize-diagnostics-path /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/Ninja-DebugAssert/xctest-macosx-x86_64/Foundation.build/Debug/SwiftFoundation.build/Objects-normal/x86_64/NSData.dia -emit-dependencies-path /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/Ninja-DebugAssert/xctest-macosx-x86_64/Foundation.build/Debug/SwiftFoundation.build/Objects-normal/x86_64/NSData.d -emit-reference-dependencies-path /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/Ninja-DebugAssert/xctest-macosx-x86_64/Foundation.build/Debug/SwiftFoundation.build/Objects-normal/x86_64/NSData.swiftdeps -o /Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/Ninja-DebugAssert/xctest-macosx-x86_64/Foundation.build/Debug/SwiftFoundation.build/Objects-normal/x86_64/NSData.o
/Users/buildnode/jenkins/workspace/swift-corelibs-xctest-PR-osx/swift-corelibs-foundation/Foundation/NSData.swift:414:32: error: use of unresolved identifier 'Glibc'
                bytesWritten = Glibc.write(fd, buf.advanced(by: length - bytesRemaining), bytesRemaining)
                               ^~~~~

It appears that corelibs-foundation's NSData.swift is using Glibc on all platforms, not just OS X. This needs a platform check. I commented on swiftlang/swift-corelibs-foundation#323, which introduced the change.

@modocache
Copy link
Contributor

Of course, the OS X corelibs-foundation failure has nothing to do with the changes in this pull request, which look good to me (and pass on Linux). I'll merge this now.

Is there a radar or JIRA issue we can use to track the SDK overlay change? It'd be nice to know when the APIs come into sync.

@modocache modocache merged commit 2c673fa into swiftlang:master Apr 16, 2016
@mike-ferris
Copy link
Author

Thanks @modocache !

@parkera
Copy link
Contributor

parkera commented Apr 16, 2016

Looks like the write function may have conflicted with data's; so the commit prefixed it with Glibc.

@modocache
Copy link
Contributor

Looks like it'll need to be something like:

#if os(Linux) || os(FreeBSD) || os(Android)
                bytesWritten = Glibc.write(fd, buf.advanced(by: length - bytesRemaining), bytesRemaining)
#else
                bytesWritten = Darwin.write(fd, buf.advanced(by: length - bytesRemaining), bytesRemaining)
#endif

Boy, I should really follow up on my "unify Darwin and Glibc" evolution proposal! 😝

aalemayhu referenced this pull request in swiftlang/swift-corelibs-foundation Apr 18, 2016
@mbvreddy
Copy link

swiftlang/swift-corelibs-foundation#333 is raised to fix NSData cross compilation issue

@mike-ferris mike-ferris deleted the Swift3Renaming branch April 18, 2016 19:20
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