scalatest / scalatest-eclipse-plugin

ScalaTest plugin for Scala IDE
scalatest.org
41 stars 20 forks source link

ScalaTest support in Scala IDE

This project contains plugins for seamless support of scalatest in Scala IDE.

This is a work in progress. Please file tickets_ if you encounter problems.

Building

Maven is used to manage the build process. You can build the project for Scala IDE nightly releases.

For stable release of Scala IDE, we recommend you to install from update sites listed here:-

For milestones release of Scala IDE, we recommend you to install from update sites listed here:-

To build for Scala IDE nightly, please make sure you have the following installed:-

You then clone and checkout master trunk:-

`$ git clone git://github.com/scalatest/scalatest-eclipse-plugin.git`

`$ cd scalatest-eclipse-plugin`

`$ git checkout nightly`

Finally use the following commands to build for Scala IDE nightly:

`$ mvn clean package`

The built update site will be available in org.scala-ide.sdt.scalatest.update-site/target.

.. _scalatest: http://scalatest.org .. _Scala IDE: http://scala-ide.org .. _tickets: http://scala-ide.org/docs/user/community.html .. _scala-ide/scala-ide: http://github.com/scala-ide/scala-ide

Using ScalaTest Plugin in Scala IDE

What is in this guide?

This guide will show you how to use the ScalaTest plugin in Scala IDE 3.0.x.

Prerequisites .............

Using ScalaTest in a Scala project

To use ScalaTest in your Scala project, you must download ScalaTest and include it in Build path of your project.

You can use ScalaTest 1.x or the latest 2.x (recommended). Using ScalaTest 2.x enables the following:-

When using ScalaTest 1.x, the GUI Runner provided by ScalaTest will be used instead of the built-in test result view.

.. image:: http://www.scalatest.org/assets/images/eclipseScreenshot.png :alt: Run using ScalaTest 2.x :width: 100% :target: http://www.scalatest.org/assets/images/eclipseScreenshot.png

.. image:: http://www.scalatest.org/assets/images/eclipseScreenshot18.png :alt: Run using ScalaTest 1.x :width: 100% :target: http://www.scalatest.org/assets/images/eclipseScreenshot18.png

Running a Selected Suite

To run a selected suite, you can select the suite using 2 different ways:-

After you choose the target suite element, just right click and choose:-

Run As -> ScalaTest - Suite

A Run Configuration with the suite name will be created automatically.

Running a Selected Test

To run a selected test, click on the target test element in the editor, right click and choose:-

Run As -> ScalaTest - Test

A Run Configuration with the test name will be created automatically.

Running a Selected Scope

To run a selected scope, click on the target scope element in the editor, right click and choose:-

Run As -> ScalaTest - Test

A Run Configuration with the scope name will be created automatically.

Running All Suites in a Selected File

To run all ScalaTest suites in a selected file, you can select the file using 2 different ways:-

After you choose the target Scala source file, just right click and choose:-

Run As -> ScalaTest - File

All ScalaTest suites in the selected Scala source file will be run.

A Run Configuration with the file name will be created automatically.

Running All Suites in Selected Package

To run all ScalaTests suites in a package, you can right click on a package in Project Explorer and choose:-

Run As -> ScalaTest Package

All ScalaTest suites in the selected package (not nested package) will be run. To include ScalaTest suites in nested packages, you'll need to select the 'Include Nested' option in the Run Configuration.

A Run Configuration with the package name will be created automatically.

Run Configuration Types