How to run package level scalatest in Eclipse

I use ScalaTest in Eclipse (Juno) with Scala 2.10, and the RunConfigurations window has the ability to run a test file, test suite or test suite. When I right-click on the package name in the explorer window, it is possible to run the package (thereby performing all the tests in this package). However, when I do this, the tests are not executed, 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, can I run all the tests in the package?

+2
source share
2 answers

This is the blind presenter, the blind, but I found that when you move the test classes to the same package as the tested classes, it works.

Weird

0
source

Here's how I got all my tests to run from Eclipse Run Configurations:

  • Choose Run-> Run Configurations
  • Select the ScalaTest folder on the left from the drop-down list.
  • Click the "New Breakfast Configuration" button in the upper left corner
  • On the "Home" tab, specify the test run configuration that has some meaningful name, and make sure that the target project is selected, and then select "Lux" as the type "Type"
  • In the "Class class" field, enter the name of the package at a level that necessarily contains all your tests, for example, "org.fred.myprog. *". Note the wildcard character "*".
  • Click the "Apply" button and go to the "Arguments" tab.
  • In the "VM Arguments" field, put something like this "-XX: PermSize = 64m -XX: MaxPermSize = 256m -Xms256m -Xmx512m". This is necessary because wildcard detection is usually hungry.
  • Click the Apply button, and then the Run button.
+1
source

All Articles