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
Add test for Test module. #143
Conversation
func testModuleWithTests() { | ||
fixture(name: "SwiftTesting/SingleTarget", file: #file, line: #line) { prefix in | ||
XCTAssertBuilds(prefix) | ||
print(prefix) |
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.
should print be there in tests?
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.
👍 Thanks. Fixed
6f8dd63
to
4b04f73
Compare
Awesome! Would love to see this and more tests for the test module merged. |
Me to :) Not sure if this test, and other, related to tests module, should be in a separate file? |
On Linux it has a different name. Also needs the other Linux machinery. |
3785e92
to
4b04f73
Compare
Like that? I haven't tested it on linux, hope it will work :) |
Not quite, there is only one |
375aa4d
to
8dd9fe8
Compare
Is there anything I should with it? |
👌 |
XCTAssertDirectoryExists(prefix, ".build", "debug", "Package.xctest") | ||
#else | ||
//FIXME: test-Package not generated during swift-build on linux so this will fail. | ||
//XCTAssertFileExists(prefix, ".build", "debug", "test-Package") |
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.
This should work, I'm confused, something doesn't work?
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.
XCTAssertBuilds
calls executeSwiftBuild
which runs swift build
,
test-Package
executable is generated when "test" target is built
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.
Of course. Well, we should run swift 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.
Ok, I will fix it. Thanks for feedback
8879598
to
6690557
Compare
@mxcl I've added |
@swift-ci Please test |
@modocache Can I get any help why tests are failing, have any ideas or tips?
|
@kostiakoval platform? On OS X don't build swift with xctest, on Linux you also have to build foundation now and depending on how you invoke the tests, tell the system where to find it. |
I'm not sure how to pass those parameters. From what I see we can't pass any arguments to I would appreciate any help please . |
Thanks again for working on this, @kostiakoval! I think it'll be really cool to not only test corelibs-xctest's behavior (which we do in corelibs-xctest), but also the behavior of the First off as a basic sanity check I pulled down the latest revision on master for all repositories onto my Ubuntu 15.10 machine and ran:
This succeeded. I then tried to pull in the changes from your pull request locally:
Re-running the Swift
I seem to recall that Anyway, silly me, I guess I probably should have tested exactly your changes, and not them merged into
But unfortunately this time I get Swift 3-related errors. I'll try to checkout pre-Swift 3 versions of all the Swift libraries and re-run your pull request. In the meantime, if you could rebase your changes onto the latest swiftpm master branch and fix up the build errors, that'd be super helpful! 🙇 |
Because of the above I'm not able to test this out myself, but my current theory is that you'll need to pass flags to In the A corelibs-foundation framework is included with Swift snapshot releases. If you're interested in having the tests use the currently installed version, then you can link that one. But I imagine that in order for this test to be robust, you'd want to allow a path to a Foundation framework to be specified somehow... |
b813132
to
82a562f
Compare
@modocache Thanks for you amazing feedback! @mxcl Can we run CI to see if we still have that error on Linux? |
@swift-ci Please test |
When I try to run test on Linux, even from the master repo, I get this error ./Utilities/bootstrap test
|
On linux you have to specify the path to: See |
You now must also specify the path to Foundation, using |
Honestly it is better to run the tests via the swift build-script. I use:
Though obviously this builds the whole of swift. So… |
Yes that's right. But how can I specify Does swift-corelibs-xctest support it now? |
@kostiakoval I was able to fix by just changing this ankitspd@772335d
|
c373ff9
to
33ea130
Compare
You can't, this is not a supported execution model. |
The problem was in wrong naming. I've tested it local and it works. |
Conflicts. |
33ea130
to
d760714
Compare
d760714
to
414729a
Compare
@mxcl Fixed. And cleaned up commits |
👍 |
@swift-ci Please test |
@kostiakoval Tests failed on Linux, can you please take a 👀 ? |
I found how to reproduce that bug. It works fine if you run |
I've tried to make this work on Linux and my conclusion is we shouldn't bother with this test:
Instead we could add an integration test, but really we don't even need to because we test swift-test when we test ourselves. So I'd like to close this, if there are no objections. |
I agree with point 1. I've opened that PR because some I agree to close that PR and find a better way to test it. |
@mxcl If we can find a way to still implement something like @kostiakoval Exactly why I'm following this PR - I had my projects break on a snapshot bc |
This PR doesn't test layouts. But I agree we should test layouts. We don't have to do it functionally. Would be better to have unit tests for that component. |
…endency-cycles Make cycle information available to the client
[pull] swiftwasm from master
Check that Package.xctest are generated.