All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dotty.tools.dotc.coverage.Coverage.scala Maven / Gradle / Ivy

There is a newer version: 3.6.4-RC1-bin-20241220-0bfa1af-NIGHTLY
Show newest version
package dotty.tools.dotc
package coverage

import scala.collection.mutable

/** Holds a list of statements to include in the coverage reports. */
class Coverage:
  private val statementsById = new mutable.LongMap[Statement](256)

  def statements: Iterable[Statement] = statementsById.values

  def addStatement(stmt: Statement): Unit = statementsById(stmt.id) = stmt


/**
  * A statement that can be invoked, and thus counted as "covered" by code coverage tools.
  *
  * @param line 1-indexed line number
  */
case class Statement(
    location: Location,
    id: Int,
    start: Int,
    end: Int,
    line: Int,
    desc: String,
    symbolName: String,
    treeName: String,
    branch: Boolean,
    ignored: Boolean = false
)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy