-
Notifications
You must be signed in to change notification settings - Fork 407
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
Cross compile to Scala Native #337
Conversation
|
property("throws") = throws(classOf[java.lang.Exception]) {
val s: String = null
s.length
} |
@xuwei-k This is expected, dereferencing null is undefined behavior in Scala Native. |
A test was deliberately provoking a NullPointerException to make sure that exceptions are correctly caught. However, in Scala Native, null dereferencing is undefined behavior, and such an exception cannot be caught at the moment. The test is changed to call next on an empty Iterator, as these exceptions can be caught with Scala Native.
I was sure I had updated this PR after the release of Scala Native 0.3.1, but I obviously didn't. Sorry about that. The PR is up to date and the tests have been fixed. I just need to figure out |
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 added the Travis CI configuration. I think that the failure is unrelated to my changes (it failed on the JVM). Could someone please restart the job? |
Cool :) |
@Duhemm Looks like the issue occurs after Travis merges the PR with master, where |
Updated version of #337: Cross compile to Scala Native
The next release of Scala Native is coming soon, and it will add support for test frameworks using sbt's test interface (scala-native/scala-native#755). While implementing the test interface, I cross compiled scalacheck to Scala Native.
Here are the changes that I did to get it to cross compile and work with Scala Native. Obviously, Scala Native 0.3.0 is not released yet, and you'll need to build Scala Native locally to test it. Here's what it looks like: https://travis-ci.org/Duhemm/scala-native/jobs/242582498#L2665-L2697
How to try it
master
branch if you happen to read that before the aforementioned PR is merged).After your system is set up, you can build Scala Native locally:
Then, build and
publishLocal
ly this PR. You can use the published artifact in a Scala Native project as shown here. Write your tests as usual and run them usingtest
in sbt.It would be great if we could get this PR in soon after Scala Native is released (I'll update it with the correct version numbers). Do you see things that need to be addressed in this PR while we wait for the next release of Scala Native?