Skip to content

[stdlib] Port StdlibUnittest to FreeBSD. #902

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 1 commit into from
Jan 7, 2016
Merged

[stdlib] Port StdlibUnittest to FreeBSD. #902

merged 1 commit into from
Jan 7, 2016

Conversation

dcci
Copy link
Member

@dcci dcci commented Jan 7, 2016

We almost got there :)

@lattner
Copy link
Contributor

lattner commented Jan 7, 2016

Very cool! @gribozavr is probably the best one to look at this, but he is out of town until next week. Maybe @dabrahams could also look?

@@ -16,7 +16,7 @@ import SwiftPrivateDarwinExtras

#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
import Darwin
#elseif os(Linux)
#elseif os(Linux) || os(FreeBSD)
import Glibc
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm OK with this in the short term, but as we discussed before, Glibc is not the right module name on FreeBSD.

@gribozavr
Copy link
Contributor

@dcci Thank you! For a full port, you need to modify OSVersion, _getOSVersion() and TestRunPredicate, and add a test like validation-test/stdlib/StdlibUnittestLinux.swift.

@dcci
Copy link
Member Author

dcci commented Jan 7, 2016

Uh, OK, thanks Dmitri and Chris, I'll update the pull request accordingly. BTW, is there an easy way to run a single test in the swift test suite? In LLVM I'd run llvm-lit -sv $testpath but it doesn't seem to do the trick here (unless I'm missing something).

@jrose-apple
Copy link
Contributor

Take a look at Testing.rst. It's not quite that simple but it's close. IIRC there's also a --filter option for bare lit.

(We don't have an llvm-lit because we have multiple testing configs. I guess we could do one that defaults to the host target.)

@dcci
Copy link
Member Author

dcci commented Jan 7, 2016

Update pull request after comments.

var XFailsFreeBSD = TestSuite("XFailsFreeBSD")

// CHECK: [ UXPASS ] XFailsFreeBSD.xfail iOS passes{{$}}
XFailsFreeBSD.test("xfail iOS passes").xfail(.FreeBSDAny(reason: "")).code {
Copy link
Contributor

Choose a reason for hiding this comment

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

s/iOS/FreeBSD/ ?

@dcci
Copy link
Member Author

dcci commented Jan 7, 2016

Updated fail messages -> s/iOS/FreeBSD.

@@ -1180,6 +1187,10 @@ public enum TestRunPredicate : CustomStringConvertible {
case LinuxAny(reason: let reason):
return "LinuxAny(*, reason: \(reason))"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This brace terminates the switch statement, it shouldn't be present. Does the code build for you? It fails for me.

Copy link
Member Author

Choose a reason for hiding this comment

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

hmm, it does for me, weirdly. Apparently something went wrong when I rebased and updated the pull request. Let me try again.

@dcci
Copy link
Member Author

dcci commented Jan 7, 2016

Updated. Hopefully no changes got lost this time. I also tried to squash the two commits in one. Thanks!

@gribozavr
Copy link
Contributor

@dcci Thanks, tests pass now!

gribozavr added a commit that referenced this pull request Jan 7, 2016
[stdlib] Port StdlibUnittest to FreeBSD.
@gribozavr gribozavr merged commit 66e6b2a into swiftlang:master Jan 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants