Skip to content

Windows test accomodations #23011

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

Merged
merged 2 commits into from
Mar 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion stdlib/private/StdlibUnittest/StdlibUnittest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,10 @@ class _ParentProcess {
let (_, stderrThread) = _stdlib_thread_create_block({
while !self._childStderr.isEOF {
self._childStderr.read()
while let line = self._childStderr.getline() {
while var line = self._childStderr.getline() {
if let cr = line.firstIndex(of: "\r") {
line.remove(at: cr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, we should stop adding more workarounds for getline(), and fix its behavior instead. Is there anything that depends on getline() splitting on LF only?

Copy link
Member Author

@compnerd compnerd Mar 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that would be great to fix, I just have not been able to do that properly for some reason. Its not the splitting on LF that things are dependent on, its the string matching not expecting the CR to be there that causes the problems.

}
var done: Bool
(done: done, ()) = onStderrLine(line)
if done { return }
Expand Down
2 changes: 1 addition & 1 deletion test/stdlib/OptionalTraps.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ OptionalTraps.test("UnwrapNone/location")
{ _isFastAssertConfiguration() },
reason: "this trap is not guaranteed to happen in -Ounchecked"))
.crashOutputMatches(_isDebugAssertConfiguration()
? "test/stdlib/OptionalTraps.swift, line 45"
? "OptionalTraps.swift, line 45"
: "")
.code {
expectCrashLater()
Expand Down