Class CoverageTracker

java.lang.Object
com.oracle.truffle.tools.coverage.CoverageTracker
All Implemented Interfaces:
AutoCloseable

public final class CoverageTracker extends Object implements AutoCloseable
  • Method Details

    • start

      public void start(CoverageTracker.Config config)
      Start coverage tracking with the given config.
      Parameters:
      config - The configuration for the coverage tracking.
      Throws:
      IllegalStateException - if the tracker is closed or already started.
      Since:
      19.3.0
    • end

      public void end()
      Stop tracking coverage.
      Throws:
      IllegalStateException - if called on a tracker that has not been started
      Since:
      19.3.0
    • getCoverage

      public SourceCoverage[] getCoverage()
      Returns:
      the coverage gathered thus far.
      Since:
      19.3.0
    • resetCoverage

      public SourceCoverage[] resetCoverage()
      Destructive read of the coverage data thus far (i.e. since beginning execution or or last reset)
      Returns:
      the coverage gathered since last reset or beginning of execution.
      Since:
      20.3.0
    • close

      public void close()
      Closes the CoverageTracker. This makes it unusable further.
      Specified by:
      close in interface AutoCloseable
      Since:
      19.3.0