Skip to content

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

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
Mar 2, 2016

Conversation

briancroom
Copy link
Contributor

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

@mxcl
Copy link
Contributor

mxcl commented Feb 29, 2016

Oh man. Revlock… :D

mike-ferris pushed a commit that referenced this pull request Mar 2, 2016
Update the allTests declarations for compatibility with the latest Corelibs XCTest
@mike-ferris mike-ferris merged commit 235f5dd into swiftlang:master Mar 2, 2016
@mxcl
Copy link
Contributor

mxcl commented Mar 2, 2016

👍🏻

@aciidgh
Copy link
Contributor

aciidgh 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
Copy link
Contributor Author

@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
Copy link

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

@aciidgh
Copy link
Contributor

aciidgh 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"

@aciidgh
Copy link
Contributor

aciidgh 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
Copy link
Contributor Author

@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.

aciidgh pushed a commit to aciidgh/swift-package-manager that referenced this pull request Jan 11, 2019
Commands can now report additional errors, notes and warnings, not tied
to a command process as before. This is used by the `StaleFileRemoval`
command to report deleted files and demotes all its errors to warnings.
aciidgh pushed a commit to aciidgh/swift-package-manager that referenced this pull request Jan 11, 2019
This is a follow-up to swiftlang#158 to add the newly added delegate methods to
llbuild's C API.
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