I want to do some sbt custom tasks for running tests (scalatest) by tag. For example: now I can run this in the sbt console:
sbt test-only -- -n UnitTests
I want to run this doing something like
sbt test-unit // or something like that
I also want to do the same by excluding tests
sbt test-only -- -l ExternalTests
to:
sbt test-exclude-external
For accomplishing that I'm trying to create a custom sbt task... but i don't know how to do the -- -l
stuff
val testUnit = taskKey[Unit]("Launch unit tests")
testUnit := {
// sbt test-only -- -n UnitTests
//(test in Test)
}
It will be useful if also I can run tests by namespace in a custom sbt task:
sbt testOnly integration.actors.*
Can you help me guys? I'm a little newbie with sbt :(