Hacking Guide - lrytz/efftp GitHub Wiki

Working in Eclipse

Clone the repository, run sbt eclipse and import the project into your Scala IDE 3.0 for Scala 2.10.

Known Issues (what to work on)

Check the Bug Tracker.

Writing Tests

The tests are executed using ScalaTest, however they are not traditional unit tests. Instead the tests extend PosNegSuite which allows writing Scala compiler tests in a fashion similar to partest.

For every test suite (e.g. tests/src/test/scala/scala/tools/nsc/effects/io/ClassesSuite.scala), there is a corresponding folder containing .scala source files located at tests/src/test/resources (tests/src/test/resources/scala/tools/nsc/effects/io/ClassesSuite-files/).

Every .scala file in that folder is compiled. If there is a corresponding .check file in the same folder, the test suite will ensure that the output of the compiler (the error messages) correspond to the content of that .check file.

If you change a Neg test, the easiest way to update the .check file is to override the updateCheck field in the test suite (check one of the examples). Make sure to comment out the override afterwards!

Attaching a Debugger

When running the tests in sbt (using tests/test), a JVM debugger can be attached on port 5006.

In Eclipse for instance, create a "Remote Java Application" debug configuration with connection type "Socket Attach", host "localhost", and port "5006". You can then set breakpoints within the compiler plugin, run a test and then run the debugger.