How to execute tests in a single project only in multi-module build?

sbt
Brett picture Brett · Feb 6, 2014 · Viewed 18.2k times · Source

I have a multi-module build, and would like to run tests for different sub-projects independently.

Is there a way to do this in sbt, e.g. if my multi-project build has a core and commons projects, I'd like to only run test in the commons project.

Answer

Jacek Laskowski picture Jacek Laskowski · Feb 6, 2014

Run sbt commons/test. See detailed explanation in Scopes.

You may also use the combination of two commands from sbt - changing the current project using project and executing test afterwards.

sbt "project commons" test

You can also use

sbt "; project commons; test"