Class: PluginReportinator
- Defined in:
- lib/ceedling/plugins/plugin_reportinator.rb
Instance Method Summary collapse
-
#assemble_test_results(results_list, options = {:boom => false}) ⇒ Object
Sample Test Results Output File (YAML) ======================================.
- #fetch_results(results_path, test, options = {:boom => false}) ⇒ Object
- #generate_banner(message) ⇒ Object
- #generate_heading(message) ⇒ Object
- #register_test_results_template(template) ⇒ Object
- #run_report(template, hash = nil, verbosity = Verbosity::NORMAL) ⇒ Object
- #run_test_results_report(hash, verbosity = Verbosity::NORMAL) ⇒ Object
- #set_system_objects(system_objects) ⇒ Object
- #setup ⇒ Object
-
#test_results_floor_verbosity ⇒ Object
A build's own test results -- pass or fail -- are core information a user silencing routine build chatter still wants to see; ERRORS is the floor for both, not just for a failing run.
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, ={:boom => false}) aggregated_results = new_results() results_list.each do |result_path| results = @plugin_reportinator_helper.fetch_results( result_path, ) @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, ={:boom => false}) return @plugin_reportinator_helper.fetch_results( File.join(results_path, test), ) end |
#generate_banner(message) ⇒ Object
34 35 36 |
# File 'lib/ceedling/plugins/plugin_reportinator.rb', line 34 def () return @reportinator.() end |
#generate_heading(message) ⇒ Object
38 39 40 |
# File 'lib/ceedling/plugins/plugin_reportinator.rb', line 38 def generate_heading() return @reportinator.generate_heading() 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
115 116 117 118 119 120 |
# File 'lib/ceedling/plugins/plugin_reportinator.rb', line 115 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
107 108 109 110 111 112 113 |
# File 'lib/ceedling/plugins/plugin_reportinator.rb', line 107 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 |
#setup ⇒ Object
17 18 19 |
# File 'lib/ceedling/plugins/plugin_reportinator.rb', line 17 def setup @test_results_template = nil end |
#test_results_floor_verbosity ⇒ Object
A build's own test results -- pass or fail -- are core information a user silencing routine build chatter still wants to see; ERRORS is the floor for both, not just for a failing run. Centralized here so every plugin printing post-build test results (report_tests_stdout_plugin, gcov, valgrind) agrees on the same answer instead of each hardcoding its own.
103 104 105 |
# File 'lib/ceedling/plugins/plugin_reportinator.rb', line 103 def test_results_floor_verbosity Verbosity::ERRORS end |