Skip to content

Commit

Permalink
Fix Scoverage report generation in Scala 3 (#3936)
Browse files Browse the repository at this point in the history
Fixes #3857. We were missing
one of the necessary flags, which is documented in
https://dotty.epfl.ch/docs/internals/coverage.html

Manually tested, reproduced the problem and verified the fix. I'm not
sure why the existing unit tests didn't catch it, must be something to
do with how the sandbox is set up for unit tests vs in real usage. I'm
not sure if it's worth introducing an integration test just for this so
just leaving it at manual testing for now
  • Loading branch information
lihaoyi authored Nov 10, 2024
1 parent 0d798d4 commit 3f6a03c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ trait ScoverageModule extends ScalaModule { outer: ScalaModule =>
Task {
val extras =
if (isScala3()) {
Seq(s"-coverage-out:${data().path.toIO.getPath()}")
Seq(
s"-coverage-out:${data().path.toIO.getPath()}",
s"-sourceroot:${T.workspace}"
)
} else {
Seq(
s"-P:scoverage:dataDir:${data().path.toIO.getPath()}",
Expand Down

0 comments on commit 3f6a03c

Please sign in to comment.