How to instruct sbt 0.11.x which source files contain tests

I'm new to Scala, SBT and Specs. I have created a simple specification using specs and like to run it via SBT with the "test" task. When I execute that task, I get the following error:

> test
[info] No tests to run for test:test
[success] Total time: 0 s, completed Nov 30, 2011 4:27:38 PM

I understand that I have to tell SBT which of my files are test files. The only example I have found on the SBT homepage and on Stackoverflow is this piece of code

override def includeTest(s: String) = { s.endsWith("Spec") }

which I included in my Build.scala file. It seems, however, that this does no longer work with SBT 0.11.x. I get the following compilation error

[info] Compiling 1 Scala source to /Users/gruetter/Workspaces/scala/helloscala/project/target/scala-2.9.1/sbt-0.11.1/classes...
[error] /Users/gruetter/Workspaces/scala/helloscala/project/Build.scala:4: method includeTest overrides nothing
[error]     override def includeTest(s: String) = { s.endsWith("Spec") }

Does anybody know how this is done with the new SBT version?

Thanks in advance for your help!

Cheers, Georg


Put the .scala files for tests in $project/src/test/scala instead of $project/src/main/scala

Need Your Help

groovy change bean variables using properties


Is there a way in groovy to do something like:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.