Julio
Julio

Reputation: 3

Problems to change outDir on specs2-reports

My main build.sbt has this:

name := "preowned-kittens"

def PreownedKittenProject(name: String): Project = (
  Project(name, file(name)).
    settings(
      scalaVersion  := "2.11.7",
      version       := "1.0",
      organization  := "com.preowned-kittens",
      libraryDependencies ++= Seq(
        "org.specs2" %% "specs2-core" % "3.7" % "test",
        "com.novocode" % "junit-interface" % "0.11" % "test"
      )
    )
  )

gitHeadCommitSha in ThisBuild := Process("git rev-parse HEAD").lines.head

lazy val common = (
  PreownedKittenProject("common")
    settings(
    makeVersionProperties := {
      val propFile = new File((resourceManaged in Compile). value, "version.properties")
      val content = "version=%s" format (gitHeadCommitSha.value)
      IO.write(propFile, content)
      Seq(propFile)
    },
    resourceGenerators in Compile <+= makeVersionProperties
    )
  )

lazy val analytics = (
  PreownedKittenProject("analytics")
    dependsOn(common)
    settings()
  )

and on my sub Module build.sbt file, i have this:

libraryDependencies += "org.specs2" %% "specs2-core" % "3.7" % "test"
libraryDependencies += "org.specs2" %% "specs2-html" % "3.7" % "test"
libraryDependencies += "de.vorb" % "pandoc_2.10" % "0.2.0" % "test"
libraryDependencies += "org.pegdown" % "pegdown" % "1.6.0" % "test"

testOptions += Tests.Argument(TestFrameworks.Specs2, "html")
javaOptions in Test += "-Dspecs2.outDir=target/generated/test-reports"
fork in Test := true

I try to reload my project and after that launch my test's and on the results

the specs2 report is located on the default location: ../analytics/target/specs2-reports/org.preownedkittens.LogicSpec.html

My sbt-version is:
sbt.version = 0.13.8

scalaVersion := "2.11.7"

Upvotes: 0

Views: 114

Answers (1)

Eric
Eric

Reputation: 15557

You should pass html.outdir with 3.7:

testOptions += Tests.Argument(TestFrameworks.Specs2, "html", 
                              "html.outdir", "target/generated/test-reports") 

Upvotes: 0

Related Questions