问题
I am trying to use ScalaTest (with Scala 2.11.0 and SBT 0.13.x) to generate a single HTML report for a project with many sub projects. To do this, I put the following line in my build.sbt:
testOptions in ThisBuild += Tests.Argument(TestFrameworks.ScalaTest, "-h", "target/test-reports")
And I have included the pegdown library that is needed for this facility...
libraryDependencies in ThisBuild ++= Seq(
"org.scalatest" %% "scalatest" % "2.1.7" % "test",
"org.pegdown" % "pegdown" % "1.4.2" % "test"
)
When I execute my tests, the index.html files of the test output overwrite each other, so whichever executes last "wins" and the other tests do not appear in the index.
The output that I am trying to achieve is similar to what unidoc does. Unidoc can create a single set of HTML ScalaDoc files that spans subprojects.
Is it possible to do what I'm attempting here? Is my issue with ScalaTest or with SBT?
To make the situation more clear, I have created a github project that demonstrates the affect (and has both unidoc and ScalaTest hooked in):
https://github.com/MartinSnyder/scalatest-multiproject-example
回答1:
Faced a similar issue so have created a file which generates the html for all test classess and a single html with overall tabular report and a piechart report. You can also generate a zip folder containing all html files.Below is a link to the project.
https://github.com/siddharth23/simple-html
来源:https://stackoverflow.com/questions/23961332/can-scalatest-generate-a-single-html-report-for-all-subprojects