-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add infrastructure to run the JUnit tests of upstream Scala.js. #6365
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
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.
Hello, and thank you for opening this PR! 🎉
All contributors have signed the CLA, thank you! ❤️
Commit Messages
We want to keep history, but for that to actually be useful we have
some rules on how to format our commit messages (relevant xkcd).
Please stick to these guidelines for commit messages:
- Separate subject from body with a blank line
- When fixing an issue, start your commit message with
Fix #<ISSUE-NBR>:
- Limit the subject line to 72 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Use the imperative mood in the subject line ("Add" instead of "Added")
- Wrap the body at 80 characters
- Use the body to explain what and why vs. how
adapted from https://chris.beams.io/posts/git-commit
Have an awesome day! ☀️
5ae11f6
to
8f16d9e
Compare
Rebased. Ready for review. |
@sjrd, it looks like you are missing a dependency in the bootstrapped test |
@nicolasstucki Indeed, thanks. It's fixed now. |
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.
Reviewed the build changes.
if (!trgDir.exists) { | ||
s.log.info(s"Fetching Scala.js source version $ver") | ||
IO.createDirectory(trgDir) | ||
new CloneCommand() |
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.
Why clone the repo instead of fetching the source jar like we do for scalajs-ir ?
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.
Because this is a test-only artifact, which is not published at all (nor binary jar nor sources jar).
|
||
import org.scalajs.ir.ScalaJSVersions | ||
|
||
object ConstantHolderGenerator { |
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.
We already use sbt-buildinfo for doing something similar, and I think one code generator thing is already too much :)
// Replace the JVM JUnit dependency by the Scala.js one | ||
libraryDependencies ~= { | ||
_.filter(!_.name.startsWith("junit-interface")) | ||
lazy val sjsJUnitTests = project.in(file("tests/sjs-junit")). |
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.
Add a documentation comment explaining the purpose of this project.
In dotty, `mangledString` does not mangle operators that are not at the end of an identifier, nor characters that are not JavaIdentifierPart's. This is OK for the JVM, but not the Scala.js IR. This commit forces full encoding of all characters.
Except those related to non-native JS classes.
The assertion fails for `OFFSET$x` fields at the moment. We'll re-enable it when that is taken care of.
Instead emit a placeholder `throw null`. Actually producing correct code for `Match` nodes is deferred for now.
cd9fed2
to
8695f5f
Compare
And run one test for now: `compiler/IntTest.scala`.
@smarter Updated. I did not migrate to sbt-buildinfo, because it generates a |
The easiest fix I think would be to change our Scala2x support to not go through these static methods, this raises cold performance concerns (#5928) but it should have the correct semantics and be consistent with how we handle Dotty trait methods. |
Build changes LGTM. I'll defer to @nicolasstucki for the code changes :). |
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.
The code changes LGTM
And fix a number of bugs, just enough to be able to compile and successfully run
compiler/IntTest.scala
.Based on #6304 and #6366.