Sha256: 39b76e8bf20023165e03bd5a0cc04742a648b737ee3447fd48ace3560c2c55fd

Contents?: true

Size: 1.9 KB

Versions: 26

Compression:

Stored size: 1.9 KB

Contents

require 'constants'
require 'defaults'

class PluginReportinator
  
  constructor :plugin_reportinator_helper, :plugin_manager, :reportinator

  def setup
    @test_results_template = nil
  end
  
  
  def set_system_objects(system_objects)
    @plugin_reportinator_helper.ceedling = system_objects
  end
  
  
  def fetch_results(results_path, test, options={:boom => false})
    return @plugin_reportinator_helper.fetch_results( File.join(results_path, test), options )
  end

  
  def generate_banner(message)
    return @reportinator.generate_banner(message)
  end

  
  def assemble_test_results(results_list, options={:boom => false})
    aggregated_results = get_results_structure
    
    results_list.each do |result_path| 
      results = @plugin_reportinator_helper.fetch_results( result_path, options )
      @plugin_reportinator_helper.process_results(aggregated_results, results)
    end

    return aggregated_results
  end
  
  
  def register_test_results_template(template)
    @test_results_template = template if (@test_results_template.nil?)
  end
  
  
  def run_test_results_report(hash, verbosity=Verbosity::NORMAL, &block)
    run_report( $stdout,
                ((@test_results_template.nil?) ? DEFAULT_TESTS_RESULTS_REPORT_TEMPLATE : @test_results_template),
                hash,
                verbosity,
                &block )
  end
  
  
  def run_report(stream, template, hash=nil, verbosity=Verbosity::NORMAL)
    failure = nil
    failure = yield() if block_given?
  
    @plugin_manager.register_build_failure( failure )
    
    @plugin_reportinator_helper.run_report( stream, template, hash, verbosity )
  end
  
  private ###############################
  
  def get_results_structure
    return {
      :successes => [],
      :failures  => [],
      :ignores   => [],
      :stdout    => [],
      :counts    => {:total => 0, :passed => 0, :failed => 0, :ignored  => 0, :stdout => 0}
      }
  end
 
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
ceedling-0.13.0 lib/plugin_reportinator.rb
ceedling-0.13.0.rc1 lib/plugin_reportinator.rb
ceedling-0.12.2 new_project_template/vendor/ceedling/lib/plugin_reportinator.rb
ceedling-0.12.1 new_project_template/vendor/ceedling/lib/plugin_reportinator.rb
ceedling-0.12.0 new_project_template/vendor/ceedling/lib/plugin_reportinator.rb
ceedling-0.11.2 new_project_template/vendor/ceedling/lib/plugin_reportinator.rb
ceedling-0.11.1 new_project_template/vendor/ceedling/lib/plugin_reportinator.rb
ceedling-0.11.0 new_project_template/vendor/ceedling/lib/plugin_reportinator.rb
ceedling-0.10.0 new_project_template/vendor/ceedling/lib/plugin_reportinator.rb
ceedling-0.9.4 new_project_template/vendor/ceedling/lib/plugin_reportinator.rb
ceedling-0.9.2 new_project_template/vendor/ceedling/lib/plugin_reportinator.rb
ceedling-0.9.0 new_project_template/vendor/ceedling/lib/plugin_reportinator.rb
ceedling-0.0.18 new_project_template/vendor/ceedling/lib/plugin_reportinator.rb
ceedling-0.0.17 new_project_template/vendor/ceedling/lib/plugin_reportinator.rb
ceedling-0.0.16 new_project_template/vendor/ceedling/lib/plugin_reportinator.rb
ceedling-0.0.15 new_project_template/vendor/ceedling/lib/plugin_reportinator.rb
ceedling-0.0.14 new_project_template/vendor/ceedling/lib/plugin_reportinator.rb
ceedling-0.0.13 new_project_template/vendor/ceedling/lib/plugin_reportinator.rb
ceedling-0.0.12 new_project_template/vendor/ceedling/lib/plugin_reportinator.rb
ceedling-0.0.8 new_project_template/vendor/ceedling/lib/plugin_reportinator.rb