Class: PluginReportinator

Inherits:
Object show all
Defined in:
lib/ceedling/plugins/plugin_reportinator.rb

Instance Method Summary collapse

Instance Method Details

#assemble_test_results(results_list, options = {:boom => false}) ⇒ Object

Sample Test Results Output File (YAML)

TestUsartModel.fail:

:source:

:file: test/TestUsartModel.c
:dirname: test
:basename: TestUsartModel.c

:successes:

  • :test: testGetBaudRateRegisterSettingShouldReturnAppropriateBaudRateRegisterSetting :line: 24 :message: '' :unity_test_time: 0
  • :test: testGetFormattedTemperatureFormatsTemperatureFromCalculatorAppropriately :line: 49 :message: '' :unity_test_time: 0
  • :test: testShouldReturnErrorMessageUponInvalidTemperatureValue :line: 55 :message: '' :unity_test_time: 0
  • :test: testShouldReturnWakeupMessage :line: 61 :message: '' :unity_test_time: 0 :failures:
  • :test: testFail :line: 39 :message: Expected 2 Was 3 :unity_test_time: 0 :ignores:
  • :test: testIgnore :line: 34 :message: '' :unity_test_time: 0 :counts: :total: 6 :passed: 4 :failed: 1 :ignored: 1 :stdout: [] :time: 0.006512000225484371


87
88
89
90
91
92
93
94
95
96
# File 'lib/ceedling/plugins/plugin_reportinator.rb', line 87

def assemble_test_results(results_list, options={:boom => false})
  aggregated_results = new_results()

  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

#fetch_results(results_path, test, options = {:boom => false}) ⇒ Object



30
31
32
# File 'lib/ceedling/plugins/plugin_reportinator.rb', line 30

def fetch_results(results_path, test, options={:boom => false})
  return @plugin_reportinator_helper.fetch_results( File.join(results_path, test), options )
end

#generate_banner(message) ⇒ Object



34
35
36
# File 'lib/ceedling/plugins/plugin_reportinator.rb', line 34

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

#generate_heading(message) ⇒ Object



38
39
40
# File 'lib/ceedling/plugins/plugin_reportinator.rb', line 38

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

#register_test_results_template(template) ⇒ Object



21
22
23
# File 'lib/ceedling/plugins/plugin_reportinator.rb', line 21

def register_test_results_template(template)
  @test_results_template = template
end

#run_report(template, hash = nil, verbosity = Verbosity::NORMAL) ⇒ Object



106
107
108
109
110
111
# File 'lib/ceedling/plugins/plugin_reportinator.rb', line 106

def run_report(template, hash=nil, verbosity=Verbosity::NORMAL)
  output = ERB.new( template, trim_mode: "%<>" )

  # Run the report template and log result with no log level heading
  @loginator.log( output.result(binding()), verbosity, LogLabels::NONE )
end

#run_test_results_report(hash, verbosity = Verbosity::NORMAL) ⇒ Object



98
99
100
101
102
103
104
# File 'lib/ceedling/plugins/plugin_reportinator.rb', line 98

def run_test_results_report(hash, verbosity=Verbosity::NORMAL)
  if @test_results_template.nil?
    raise CeedlingException.new( "No test results report template has been set." )
  end

  run_report( @test_results_template, hash, verbosity )
end

#set_system_objects(system_objects) ⇒ Object



25
26
27
28
# File 'lib/ceedling/plugins/plugin_reportinator.rb', line 25

def set_system_objects(system_objects)
  # Available for use inside ERB report rendering via binding()
  @ceedling = system_objects
end

#setupObject



17
18
19
# File 'lib/ceedling/plugins/plugin_reportinator.rb', line 17

def setup
  @test_results_template = nil
end