Module: Henitai::Integration::CoverageRuntimeSuppressors

Defined in:
lib/henitai/integration.rb

Overview

Suppresses expensive and irrelevant coverage startup/teardown during mutant child runs. Coverage artifacts are only required during the dedicated bootstrap phase.

Class Method Summary collapse

Class Method Details

.suppress_coverage!Object



801
802
803
804
805
806
807
808
809
# File 'lib/henitai/integration.rb', line 801

def self.suppress_coverage!
  require "coverage"
  cov = Object.const_get(:Coverage) # steep:ignore Ruby::UnknownConstant
  return if cov.singleton_class.ancestors.include?(CoverageStartSuppressor)

  cov.singleton_class.prepend(CoverageStartSuppressor)
rescue LoadError, NameError
  nil
end

.suppress_simplecov!Object



790
791
792
793
794
795
796
797
798
799
# File 'lib/henitai/integration.rb', line 790

def self.suppress_simplecov!
  require "simplecov"
  sc = Object.const_get(:SimpleCov) # steep:ignore Ruby::UnknownConstant
  sc.external_at_exit = true if sc.respond_to?(:external_at_exit=)
  return if sc.singleton_class.ancestors.include?(SimpleCovStartSuppressor)

  sc.singleton_class.prepend(SimpleCovStartSuppressor)
rescue LoadError, NameError
  nil
end