Skip to content

Instantly share code, notes, and snippets.

@tarao
Last active November 14, 2023 09:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tarao/43d2c4263478c91ae3d5e21f314a7e13 to your computer and use it in GitHub Desktop.
Save tarao/43d2c4263478c91ae3d5e21f314a7e13 to your computer and use it in GitHub Desktop.
object A {
def hello(): Unit =
println("hello")
}
// addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.9")
val Scala_3 = "3.3.1"
val Scala_2_13 = "2.13.12"
ThisBuild / scalaVersion := Scala_3
ThisBuild / crossScalaVersions := Seq(Scala_2_13, Scala_3)
lazy val root = (project in file("."))
#!/bin/sh
set -x
sbt 'reload plugins' 'set addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.9")' \
'session save' 'reload return' \
"++ $1" coverage test
rm project/build.sbt
# Coverage data, format version: 3.0
# Statement data:
# - id
# - source path
# - package name
# - class name
# - class type (Class, Object or Trait)
# - full class name
# - method name
# - start offset
# - end offset
# - line number
# - symbol name
# - tree name
# - is branch
# - invocations count
# - is ignored
# - description (can be multi-line)
# ' ' sign
# ------------------------------------------
1
A.scala
<empty>
A
Object
A
hello
37
53
3
scala.Predef.println
Apply
false
0
false
scala.Predef.println("hello")
# Coverage data, format version: 3.0
# Statement data:
# - id
# - source path
# - package name
# - class name
# - class type (Class, Object or Trait)
# - full class name
# - method name
# - start offset
# - end offset
# - line number
# - symbol name
# - tree name
# - is branch
# - invocations count
# - is ignored
# - description (can be multi-line)
# ' ' sign
# ------------------------------------------
0
A.scala
<empty>
A$
Object
<empty>.A$
hello
37
53
2
println
Apply
false
0
false
println("hello")
1
A.scala
<empty>
A$
Object
<empty>.A$
hello
13
22
1
hello
DefDef
false
0
false
def hello
@tarao
Copy link
Author

tarao commented Nov 14, 2023

> ./run.sh 2.13.12
> ./run.sh 3.3.1
> cat target/scala-2.13/scoverage-data/scoverage.coverage > scoverge.coverage.2.13.12
> cat target/scala-3.3.1/scoverage-data/scoverage.coverage > scoverge.coverage.3.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment