-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Parse specifer in swift-test #266
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
Test case? |
This is in swift-test executable which is not testable right now I think |
Why not? Seems like we should have at least one test that verifies its behavior in a functional style. |
something similar to |
I don't think we want to actually invoke |
If I remember correctly importing an executable in test errors out with duplicate symbols for main |
I've updated the PR to include two functional tests for swift-test which executes swift-test executable on a fixture. |
@@ -155,6 +155,44 @@ func executeSwiftBuild(_ chdir: String, configuration: Configuration = .Debug, p | |||
} | |||
} | |||
|
|||
func swiftTestPath() -> String { | |||
#if os(OSX) | |||
for bundle in NSBundle.allBundles() where bundle.bundlePath.hasSuffix(".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.
Every time you copy/pasta a kitten dies.
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.
saved the kitten in 852af2e
852af2e
to
db95a20
Compare
rebased fixed conflicts |
@swift-ci please test |
This passes tests on my linux VM but Linux CI is failing with this error :
@mxcl @modocache any idea? |
Here's what I think is going on. When executing in the CI environment, no swift toolchain is present, so XCTest is only available in the build directory chosen by the Swift build-script-impl. SwiftPM's bootstrap script receives a parameter with the path to the XCTest build directory (https://github.com/apple/swift/blob/master/utils/build-script-impl#L1417), and passes that through when invoking SwiftPM (https://github.com/apple/swift-package-manager/blob/master/Utilities/bootstrap#L639). I guess a mechanism will need to be introduced here to provide the XCTest build path when running these tests as well. |
It's the same error I experience before when tried to invoke |
thanks @kostiakoval for digging this out. Quoting Max's reply on that PR:
If this is still valid then can someone suggest another way to test this. |
@aciidb0mb3r Could you income |
Unit tests are not possible on executables right now due to duplicated main symbols |
Sounds like we should remove the unit test from here, merge this and separately track finding a way to unit test this code? Any objections there? |
@ddunbar no objections, updated PR |
@swift-ci Please test and merge |
Upgrade to C API version 5
The specifier was not being parsed so is never passed to xctest.
swift test <test specifier>