-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Build] Link XCTest with Foundation [AsyncXCTest 5/6] #177
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
@@ -84,7 +84,12 @@ Tests are an important part of the development and evolution of this project, | |||
and new contributions are expected to include tests for any functionality | |||
change. To run the tests, pass the `test` verb to the `bootstrap` script: | |||
|
|||
./Utilities/bootstrap --build-tests test |
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.
Can we keep the old version that doesn't require any parameter in the readme? By making tools simpler we can lover entrance barrier for contributors
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.
Does the old version work? I was unable to get Utilities/bootstrap
to succeed, even on master
, without passing in --swiftc
, --sbt
, and --xctest
. I think we should include these in the README today, not just when this pull request is merged.
I may be missing something, though. Is it possible to successfully run just Utilities/bootstrap test
?
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.
By default Utilities/bootstrap
uses swiftc
and other tools from the Toolchains specified in the PATH
and it works for me with latest toolchain on MacOS at least.
On linux it could fail because of this #158
I think it wold be useful to have both options described in readme, because often you need to use swiftc from maser
.
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.
Can do! It definitely took me a while to figure out how to test SwiftPM (the test invocation in the Swift build script isn't straightforward either), and I think more docs could help.
7807570
to
747ca15
Compare
// | ||
// This should be fixed such that it does not rely upon environment | ||
// variables. | ||
if let includes = getenv("SWIFTPM_EXTRA_IMPORTS") { |
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.
Is there any particular reason why this hack couldn't already be scrapped and replaced with additional -Xswiftc
(or -Xcc
? I'm not sure I understand which should be used when) parameters. Similar to #172
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.
Aha! Good catch, I'll give that a try!
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.
Good call, @briancroom! This pull request is much nicer now. 🎁
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.
👍 FIXMEs-=1!
4ee0afd
to
541c666
Compare
👍 |
Could someone in the Apple org kick off CI for this pull request? @mike-ferris-apple, do you have the permissions to do so? |
In order to implement asynchronous tests, swift-corelibs-xctest will take on a dependency upon swift-corelibs-foundation. To properly link the two: - Allow the package manager to take a path to a Foundation build. - Add the Foundation and CoreFoundation directories to the swiftc include paths. - While we're at it, remove the SWIFTPM_EXTRA_IMPORTS hack in favor of -Xswiftc.
541c666
to
1cabbde
Compare
@swift-ci Please test |
Yay, the tests passed! Any thoughts on this direction, though? Is the SwiftPM team fine with XCTest taking on a Foundation dependency? It'd be pretty great if that's the case--I'd love to see this merged and async tests in XCTest shipped. |
I'm fine with whatever the XCTest folks want to do. I don't intend to add Foundation to SwiftPM yet though, as I have enough rev lock issues as it stands! |
[Build] Link XCTest with Foundation [AsyncXCTest 5/6]
@mxcl Awesome! Yes, I'd read your comments on not wanting to include Foundation in SwiftPM, and so wanted to make double sure you were OK with (or at least not in staunch opposition to) this direction for XCTest. Thanks for the feedback!! 🙇 |
[BuildSystem] Add an experimental feature to expose both views of a s…
In order to implement asynchronous tests, swift-corelibs-xctest will take on a dependency upon swift-corelibs-foundation. To properly link the two:
SWIFTPM_EXTRA_IMPORTS
hack in favor of-Xswiftc
.