modifying testOptions for a task

43 views
Skip to first unread message

David Riley

unread,
Apr 12, 2013, 11:48:44 AM4/12/13
to simple-b...@googlegroups.com
Hey,
 
I want to have two separate tasks to run two types of tests from sbt (unit and regression), so ideally I would override the "test" task and create a "test-regression" task. I can easily override the classes which get run in the test task with the following:
 
testOptions in Test in ThisBuild := Seq(Tests.Filter(s => detect_tsts(s,"unit_test")))
 
def detect_tsts(s: String, starts_with: String) = {
    print("Detected test: "+s)
    val valid = s.split("
\\.").last.startsWith(starts_with)
    if(valid) println("...valid name") else println("...invalid unit test name, skipping")
    valid
  }
 
However I'm not sure how to create a separate task which would use a modified list?
 
  lazy val testRegression = TaskKey[Unit]("test-regression", "run regression tests")
 
  def regressionTestTask = testRegression <<=  ????
 
Everything I have tried so far seems to just discard the changes to testOptions
 
Thanks
 
David

Mark Harrah

unread,
Apr 15, 2013, 11:21:26 AM4/15/13
to simple-b...@googlegroups.com
Have you seen this?

http://www.scala-sbt.org/release/docs/Detailed-Topics/Testing#additional-test-configurations

-Mark

> Thanks
>
> David
>
> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-t...@googlegroups.com.
> To post to this group, send email to simple-b...@googlegroups.com.
> Visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Reply all
Reply to author
Forward
0 new messages