Hello.
Just sharing my experience in launching scalatest from under Eclipse.
Thanks to Bill Venners, I've finally made it run. Maybe nothing special for
you, but a big step for me.
So, what we need to download first (put it in any place where you think it
should be)
- scalatest
- scalacheck [if needed]
- junit [if not already installed by default]
If you want to have the scalatest libraries for your project (it helps to
compile tests from within Eclipse), do as follow:
- *Project* -> *Properties... -> Java Build Path -> Libraries*
- [Add External JARSs] => Add scalatest-(version).jar, from where you
downloaded it.
Creating run configuration:
- *Run *-> *Run Configuration *-> *Scala Application *-> *New*
- [Main] -> Main class: *org.scalatest.tools.Runner*
- [Arguments] -> Program arguments: -s your.test/suite.class.Name (there's
another argument, -p; seems like it is not needed here)
- [Classpath] [if not added globally]: Here you add paths to scalatest,
scalacheck, junit, and your default classpath (that's probably already
there)
That's it, for running the GUI-based version of the Scala tester. To run
your test suite in a console-only alternative mode:
- You need the same downloads as before.
- For this, you also need the official Scala Eclipse plugin. (NOTE: This
procedure was written based on Scala Eclipse plugin 2.7.4-final)
- Instead of manually creating the Run Configuration for ScalaTest's
Runner, right-click where you want to store your "runnable" test runner, and
create a new *Scala Application*. Assuming you defined a test suite
called *StackSuite*, call this something like *StackSuiteRunner*.
- Fill in the stubbed out application code:
*package your.package
object StackSuiteRunner {
def main(args : Array[String]) : Unit = {
(new StackSuite).execute()
}
}*
- Save and run it. It will dump all output into the console pane.
- NOTE: While I was able to also run this as a TestNG suite, it only
printed one entry for the entire suite, which was less informative than the
pure console output.
--
Cheers,
Pratik K Anand
[Non-text portions of this message have been removed]