user3061128
user3061128

Reputation: 1

Running scalatest classes from sbt file

I am running my test class from sbt file using task

scalaTaskRun := {
  val test = (runMain in Compile).fullInput(" org.scalatest.tools.Runner -s package.tests.TestClass1 -h ReportOutput").evaluated
}

to get a html report output for single test class. But I don't want to add -s TestClass2 again for running one more tests and so on...

If I want to run many test classes from sbt file just like running testNG suite xml which contains more than one test classes. How can the same thing be achieved in sbt scalatest??

I tried running with the runpath command...

Runner -R target\\folder\\classes -w package.testcases -h reportFolder

But it's not running the compiled test classes from classes folder.

Kindly help in fixing it.

Upvotes: 0

Views: 259

Answers (1)

Seth Tisue
Seth Tisue

Reputation: 30498

You can tell sbt which tests you want to run:

testOnly package.testcases.* -- -h reportFolder

everything after -- gets passed through to the test framework (e.g. ScalaTest).

Upvotes: 1

Related Questions