Class: PluginReportinator

Inherits:
Object show all
Defined in:
lib/ceedling/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



85
86
87
88
89
90
91
92
93
94
# File 'lib/ceedling/plugin_reportinator.rb', line 85

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



28
29
30
# File 'lib/ceedling/plugin_reportinator.rb', line 28

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



32
33
34
# File 'lib/ceedling/plugin_reportinator.rb', line 32

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

#generate_heading(message) ⇒ Object



36
37
38
# File 'lib/ceedling/plugin_reportinator.rb', line 36

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

#register_test_results_template(template) ⇒ Object



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

def register_test_results_template(template)
  @test_results_template = template
end

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



109
110
111
112
113
114
115
116
117
118
119
# File 'lib/ceedling/plugin_reportinator.rb', line 109

def run_report(template, hash=nil, verbosity=Verbosity::NORMAL)
  failure = nil
  failure = yield() if block_given?

  @plugin_manager.register_build_failure( failure )

  # Set verbosity to error level if there were failures
  verbosity = failure ? Verbosity::ERRORS : Verbosity::NORMAL

  @plugin_reportinator_helper.run_report( template, hash, verbosity )
end

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



96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/ceedling/plugin_reportinator.rb', line 96

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

  run_report(
    @test_results_template,
    hash,
    verbosity,
    &block
  )
end

#set_system_objects(system_objects) ⇒ Object



24
25
26
# File 'lib/ceedling/plugin_reportinator.rb', line 24

def set_system_objects(system_objects)
  @plugin_reportinator_helper.ceedling = system_objects
end

#setupObject



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

def setup
  @test_results_template = nil
end