Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to run scalatest at package level in Eclipse

I'm using ScalaTest in Eclipse (Juno) with Scala 2.10, and the RunConfigurations window has the ability to run a test file, a test suite, or a test package. When I right click on a package name in the explorer window, there is an option to run the package (thereby running all the tests in that package). However, when I do that, no tests run and it displays this:

WARNING: -p has been deprecated and will be reused for a different (but still very cool) purpose in ScalaTest 2.0. Please change all uses of -p to -R.
Run starting. Expected test count is: 0
DiscoverySuite:
Run completed in 57 milliseconds.
Total number of tests run: 0
Suites: completed 1, aborted 0
Tests: succeeded 0, failed 0, ignored 0, pending 0
All tests passed.

So, what else do I need to do so I can run all the tests in the package?

like image 932
egprentice Avatar asked Dec 06 '25 08:12

egprentice


1 Answers

This is how I got all my tests to run from an Eclipse Run Configurations:

  • Select Run->Run Configurations
  • In the pop-up select the ScalaTest "folder" on the left
  • Click the "New lunch configuration" button in the upper left corner
  • On the Main tab give your test run configuration some meaningful name and ensure that your target project is selected, and then select the "Suite" radiobutton as a Type
  • In the "Suite Class" field, type in the name of a package at a level that is certain to contain all your tests, for example "org.fred.myprog.*". Note the wildcard "*".
  • Hit the Apply button and switch to the Arguments tab
  • In the "VM Arguments" field put something like this "-XX:PermSize=64m -XX:MaxPermSize=256m -Xms256m -Xmx512m". This is needed because the test discovery triggered by the wildcard tends to be memory-hungry.
  • Hit the Apply button and then the Run button.
like image 145
Krzysiek Novak Avatar answered Dec 09 '25 00:12

Krzysiek Novak