Update the allTests declarations for compatibility with the latest Corelibs XCTest #158

Merged
merged 1 commit into from Mar 2, 2016

Conversation

Projects
None yet
4 participants
@briancroom
Collaborator

briancroom commented Feb 29, 2016

This includes the necessary changes for the test suite to build and run with the swift-corelibs-xctest changes proposed in apple/swift-corelibs-xctest#40 and should be merged in coordination with that PR.

@mxcl

This comment has been minimized.

Show comment
Hide comment
@mxcl

mxcl Feb 29, 2016

Contributor

Oh man. Revlock… :D

Contributor

mxcl commented Feb 29, 2016

Oh man. Revlock… :D

@mxcl mxcl referenced this pull request Feb 29, 2016

Closed

[WIP] Automatic Linux test manifest generation #156

7 of 9 tasks complete

mike-ferris pushed a commit that referenced this pull request Mar 2, 2016

Mike Ferris
Merge pull request #158 from briancroom/update_allTests
Update the allTests declarations for compatibility with the latest Corelibs XCTest

@mike-ferris mike-ferris merged commit 235f5dd into apple:master Mar 2, 2016

@mxcl

This comment has been minimized.

Show comment
Hide comment
@mxcl

mxcl Mar 2, 2016

Contributor

👍🏻

Contributor

mxcl commented Mar 2, 2016

👍🏻

@briancroom briancroom deleted the briancroom:update_allTests branch Mar 2, 2016

@aciidb0mb3r

This comment has been minimized.

Show comment
Hide comment
@aciidb0mb3r

aciidb0mb3r Mar 2, 2016

Member

this is breaking with latest tool chain

/home/aciid/swift/swift-package-manager/Tests/PackageType/PackageNameTests.swift:14:7: error: type 'PackageTests' does not conform to protocol 'XCTestCaseProvider'
class PackageTests: XCTestCase {
      ^
XCTest.XCTestCaseProvider:2:16: note: protocol requires property 'allTests' with type '[(String, () throws -> Void)]'
    public var allTests: [(String, () throws -> Void)] { get }
               ^
/home/aciid/swift/swift-package-manager/Tests/PackageType/PackageNameTests.swift:39:16: note: candidate operates on a type, not an instance as required
    static var allTests : [(String, PackageTests -> () throws -> Void)] {
               ^
Compiling Swift Module 'PackageDescriptiontest' (2 sources)
/home/aciid/swift/swift-package-manager/Tests/Build/DescribeTests.swift:14:13: error: type 'DescribeTests' does not conform to protocol 'XCTestCaseProvider'
final class DescribeTests: XCTestCase {
            ^
XCTest.XCTestCaseProvider:2:16: note: protocol requires property 'allTests' with type '[(String, () throws -> Void)]'
    public var allTests: [(String, () throws -> Void)] { get }
               ^
/home/aciid/swift/swift-package-manager/Tests/Build/DescribeTests.swift:28:16: note: candidate operates on a type, not an instance as required
    static var allTests: [(String, DescribeTests -> () throws -> Void)] {
               ^
Compiling Swift Module 'Utilitytest' (6 sources)
/home/aciid/swift/swift-package-manager/Tests/Utility/MiscTests.swift:15:7: error: type 'RmtreeTests' does not conform to protocol 'XCTestCaseProvider'
class RmtreeTests: XCTestCase {
Member

aciidb0mb3r commented Mar 2, 2016

this is breaking with latest tool chain

/home/aciid/swift/swift-package-manager/Tests/PackageType/PackageNameTests.swift:14:7: error: type 'PackageTests' does not conform to protocol 'XCTestCaseProvider'
class PackageTests: XCTestCase {
      ^
XCTest.XCTestCaseProvider:2:16: note: protocol requires property 'allTests' with type '[(String, () throws -> Void)]'
    public var allTests: [(String, () throws -> Void)] { get }
               ^
/home/aciid/swift/swift-package-manager/Tests/PackageType/PackageNameTests.swift:39:16: note: candidate operates on a type, not an instance as required
    static var allTests : [(String, PackageTests -> () throws -> Void)] {
               ^
Compiling Swift Module 'PackageDescriptiontest' (2 sources)
/home/aciid/swift/swift-package-manager/Tests/Build/DescribeTests.swift:14:13: error: type 'DescribeTests' does not conform to protocol 'XCTestCaseProvider'
final class DescribeTests: XCTestCase {
            ^
XCTest.XCTestCaseProvider:2:16: note: protocol requires property 'allTests' with type '[(String, () throws -> Void)]'
    public var allTests: [(String, () throws -> Void)] { get }
               ^
/home/aciid/swift/swift-package-manager/Tests/Build/DescribeTests.swift:28:16: note: candidate operates on a type, not an instance as required
    static var allTests: [(String, DescribeTests -> () throws -> Void)] {
               ^
Compiling Swift Module 'Utilitytest' (6 sources)
/home/aciid/swift/swift-package-manager/Tests/Utility/MiscTests.swift:15:7: error: type 'RmtreeTests' does not conform to protocol 'XCTestCaseProvider'
class RmtreeTests: XCTestCase {
@briancroom

This comment has been minimized.

Show comment
Hide comment
@briancroom

briancroom Mar 2, 2016

Collaborator

@aciidb0mb3r with this having been merged, the SwiftPM tests will need to be built against the master branch of corelibs-xctest rather than the version included in the toolchain. SwiftPM's bootstrap script accepts an --xctest parameter which allows specifying the directory containing the corelibs-xctest library you want to use.

It's slightly unfortunate that this got merged in so shortly after a toolchain snapshot was released since it will presumably be at least a week until the snapshots catch up. On the plus side, however, we don't foresee needing to make any more breaking changes like this as a result of working towards API compatibility with Apple XCTest.

Collaborator

briancroom commented Mar 2, 2016

@aciidb0mb3r with this having been merged, the SwiftPM tests will need to be built against the master branch of corelibs-xctest rather than the version included in the toolchain. SwiftPM's bootstrap script accepts an --xctest parameter which allows specifying the directory containing the corelibs-xctest library you want to use.

It's slightly unfortunate that this got merged in so shortly after a toolchain snapshot was released since it will presumably be at least a week until the snapshots catch up. On the plus side, however, we don't foresee needing to make any more breaking changes like this as a result of working towards API compatibility with Apple XCTest.

@mike-ferris

This comment has been minimized.

Show comment
Hide comment
@mike-ferris

mike-ferris Mar 2, 2016

Member

Ug, yeah. I didn't really think about coordinating with the snapshot dates...

Member

mike-ferris commented Mar 2, 2016

Ug, yeah. I didn't really think about coordinating with the snapshot dates...

@aciidb0mb3r

This comment has been minimized.

Show comment
Hide comment
@aciidb0mb3r

aciidb0mb3r Mar 2, 2016

Member

Posting this for reference

$ git clone https://github.com/apple/swift-corelibs-xctest
$ cd swift-corelibs-xctest
$ ./build_script.py \
    --swiftc="/home/aciid/swift/swift-DEVELOPMENT-SNAPSHOT-2016-03-01-a-ubuntu15.10/usr/bin/swiftc" \
    --build-dir=".build" \
    --library-install-path="/home/aciid/swift/swift-DEVELOPMENT-SNAPSHOT-2016-03-01-a-ubuntu15.10/usr/lib/swift/linux" \
    --module-install-path="/home/aciid/swift/swift-DEVELOPMENT-SNAPSHOT-2016-03-01-a-ubuntu15.10/usr/lib/swift/linux/x86_64"
Member

aciidb0mb3r commented Mar 2, 2016

Posting this for reference

$ git clone https://github.com/apple/swift-corelibs-xctest
$ cd swift-corelibs-xctest
$ ./build_script.py \
    --swiftc="/home/aciid/swift/swift-DEVELOPMENT-SNAPSHOT-2016-03-01-a-ubuntu15.10/usr/bin/swiftc" \
    --build-dir=".build" \
    --library-install-path="/home/aciid/swift/swift-DEVELOPMENT-SNAPSHOT-2016-03-01-a-ubuntu15.10/usr/lib/swift/linux" \
    --module-install-path="/home/aciid/swift/swift-DEVELOPMENT-SNAPSHOT-2016-03-01-a-ubuntu15.10/usr/lib/swift/linux/x86_64"
@aciidb0mb3r

This comment has been minimized.

Show comment
Hide comment
@aciidb0mb3r

aciidb0mb3r Mar 2, 2016

Member

@briancroom the --xctest built all test modules successfully but blew saying undefined symbols when trying to execute tests, installing the newer xctest into the toolchain worked

Member

aciidb0mb3r commented Mar 2, 2016

@briancroom the --xctest built all test modules successfully but blew saying undefined symbols when trying to execute tests, installing the newer xctest into the toolchain worked

@briancroom

This comment has been minimized.

Show comment
Hide comment
@briancroom

briancroom Mar 3, 2016

Collaborator

@aciidb0mb3r hmm yeah, it seems that the linker is finding the snapshot's libXCTest.so first, regardless of where the extra linker search paths are placed on the command line. I'm not seeing a way to fix that issue properly right now.

@mike-ferris-apple neither did I! Hopefully another one will be posted early next week already, though.

Collaborator

briancroom commented Mar 3, 2016

@aciidb0mb3r hmm yeah, it seems that the linker is finding the snapshot's libXCTest.so first, regardless of where the extra linker search paths are placed on the command line. I'm not seeing a way to fix that issue properly right now.

@mike-ferris-apple neither did I! Hopefully another one will be posted early next week already, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment