Sha256: 46adfad4c9baf808be725ccb9c11ed3398420eb7bfbce9c2bfe172eed465f7a3

Contents?: true

Size: 1.4 KB

Versions: 15

Compression:

Stored size: 1.4 KB

Contents

# coding: utf-8

# This is not a normal module/class.  It contains code to be run by bin/fig and
# bin/fig-debug when doing coverage.

# Depends upon setup done by spec/spec_helper.rb.
if ! ENV['FIG_COVERAGE_RUN_COUNT'] || ! ENV['FIG_COVERAGE_ROOT_DIRECTORY']
  $stderr.puts \
    'FIG_COVERAGE_RUN_COUNT or FIG_COVERAGE_ROOT_DIRECTORY not set. Cannot do coverage correctly.'
  exit 1
end

require 'simplecov'

# Normal load of .simplecov does not work because SimpleCov assumes that
# everything is relative to the current directory.  The manipulation of
# SimpleCov.root below takes care of most things, but that doesn't affect
# .simplecov handling done in the "require 'simplecov'" above.
load File.expand_path(
  File.join(ENV['FIG_COVERAGE_ROOT_DIRECTORY'], '.simplecov')
)

# We may run the identical fig command-line multiple times, so we need to give
# additional value to make the run name unique.
SimpleCov.command_name(
  "fig run #{ENV['FIG_COVERAGE_RUN_COUNT']} (#{ARGV.join(' ')})"
)
SimpleCov.root ENV['FIG_COVERAGE_ROOT_DIRECTORY']

SimpleCov.at_exit do
  # Have to invoke result() in order to get coverage data saved.
  #
  # Default at_exit() further invokes format():
  #
  #    1) We save time by not doing it on each fig run and let the rspec run
  #       handle that.
  #    2) The formatter emits a message to stdout, which screws up tests of
  #       the fig output.
  SimpleCov.result
end

SimpleCov.start

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
fig-1.27.10 lib/fig/command/coverage_support.rb
fig-1.27.8 lib/fig/command/coverage_support.rb
fig-1.27.5 lib/fig/command/coverage_support.rb
fig-1.27.4 lib/fig/command/coverage_support.rb
fig-1.27.3 lib/fig/command/coverage_support.rb
fig-1.27.0 lib/fig/command/coverage_support.rb
fig-1.26.1.beta.1 lib/fig/command/coverage_support.rb
fig-1.26.0 lib/fig/command/coverage_support.rb
fig-1.25.1.beta.1 lib/fig/command/coverage_support.rb
fig-1.25.0 lib/fig/command/coverage_support.rb
fig-1.24.1.beta.3 lib/fig/command/coverage_support.rb
fig-1.24.1.beta.2 lib/fig/command/coverage_support.rb
fig-1.24.1.beta.1 lib/fig/command/coverage_support.rb
fig-1.24.0 lib/fig/command/coverage_support.rb
fig-1.23.1.beta.1 lib/fig/command/coverage_support.rb