-
Notifications
You must be signed in to change notification settings - Fork 263
For testing on Android #200
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
Conversation
@@ -59,7 +59,9 @@ internal class PrintObserver: XCTestObservation { | |||
|
|||
fileprivate func printAndFlush(_ message: String) { | |||
print(message) | |||
#if !os(Android) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the background for this? Is this function missing from Bionic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s the absense of stdout which causes the compilation error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Further discussion of this change here)
Hey @johnno1962, thanks for the PR! I'd be interested in hearing more about the workflow you're using where you make use of this. In this situation, is XCTest is building against the copy of Foundation from the Swift toolchain? If so, why not take XCTest from the toolchain as well? |
Hi @briancroom, I’m having to roll my own XCTest as I’m preparing a toolchain for Android (http://johnholdsworth.com/bothworlds.html) and I don’t believe the build scripts have been adapted for a cross compile of XCTest (I could be wrong there.) Once it’s built I copy the shared lib and .swiftmodule into the toolchain manually and package it up. I’m using the swift-robot-environment scritps for the build - https://github.com/gonzalolarralde/swifty-robot-environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some drive-by style nits.
Package.swift
Outdated
let package = Package(name: "XCTest") | ||
let package = Package( | ||
name: "XCTest", | ||
products:[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: missing space between :
and [
Package.swift
Outdated
.library( | ||
name: "XCTest", | ||
type: .dynamic, | ||
targets:["XCTest"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: missing space between :
and [
Package.swift
Outdated
], | ||
targets: [ | ||
.target(name: "XCTest", dependencies: [], path: "Sources"), | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: de-indent ]
to match the lines above (see, for example, the closing bracket after dependencies
)
@xwu's whitespace comments are fair, and it would be good to address them before merging this, but otherwise I am fine with adding this. In the future, it would be cool if we could get the test suite to be runnable via |
With #201 merged, the remaining change here is just adding the Package.swift file. There's no point in running CI on that since it isn't involved in that build anyway. |
Thanks Brian 👍 |
Hi Apple,
These are the changes I’ve used to build XCTest for Android. I don’t know if you have other plans for Package.swift as it was but I figure since there are no version tags on this repo it cannot be used anyway.
Cheers.