-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Rewrite part of file with StdlibUnittest #487
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
Is it possible for you to also split up this file into tests for different sorts of printing (i.e. one for Array, one for Integer, one for Floating Point)? Very long stdlib unittest tests are very difficult to debug when we run into optimizer issues and splitting it into smaller files would make it easier to bisect/debug. |
@gottesmm Yes, It's possible. Do you want to see it in one big PR or in a few small PRs? |
I would suggest a few small PRs. It will make it easier to localize/fix/revert commits if issues come up. |
@gottesmm Ok. So is this PR ready to merge? :) |
I actually think I need someone on the stdlib team to review it. (I was going to review it myself, but I am not a stdlib engineer). I am going to send it to Dmitri. |
@gottesmm thanks. I will continue to work on this file |
c829a6a
to
6ee9703
Compare
@gottesmm Should I create |
I am not sure TBH. I would leave that up to @gribozavr. That being said, I imagine that if you put the tests in the Print folder, it will be ok to call the tests Print*.swift. So why not just do it in test/1_stdlib and if Dmitri wants us to create a folder, then we can move the tests to that directory in a subsequent commit. That would make it easier in terms of munging patches. |
@frootloops Thanks! Two comments:
|
fb5c31a
to
3e504d6
Compare
@gribozavr I'm still working on this PR but if you can please have a look at the PR and leave any comments. I have a few questions:
Thanks |
44a31bf
to
afd816e
Compare
@gribozavr when you will have time please have a look :) |
afd816e
to
49c8654
Compare
|
@frootloops Thank you!
Swift can share code with modules. You can put common definitions into, say, test/1_stdlib/Inputs/PrintTestTypes.swift, and build modules out of it in every test that needs these types.
Only if it fails on Linux. Let me know if I need to run these for you.
Strictly speaking, only floating point tests need it. We know from the implementation that other behavior is implemented without relying on locales.
So, the latter builds the binary for you, while for the former you need to build it yourself using another |
// REQUIRES: executable_test | ||
|
||
import Swift | ||
import Darwin |
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.
I don't think anything depends on Darwin
here.
@frootloops Please try to prune |
49c8654
to
9a3dc67
Compare
@gribozavr have a look at the PR. I updated it and if you can please run a test suite on a linux machine. |
8eed30e
to
c5dafe5
Compare
@gribozavr You were right about locale. Can you run tests on linux again? |
8fa7e70
to
df8dd0f
Compare
|
||
let PrintTests = TestSuite("PrintFloat") | ||
|
||
PrintTests.test("Locale") { |
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 be modeled as a setup block.
df8dd0f
to
6a2af7d
Compare
4016908
to
e09a904
Compare
e09a904
to
9203f36
Compare
@gribozavr thanks for comments. I updated the PR |
Rewrite part of file with StdlibUnittest
@frootloops Thank you, merged! |
No description provided.