Class: PluginManager
Instance Method Summary collapse
- #load_programmatic_plugins(plugins, system_objects) {|{ :environment => environment }| ... } ⇒ Object
- #plugins_failed? ⇒ Boolean
- #post_build(timestamp_s) ⇒ Object
- #post_compile_execute(arg_hash) ⇒ Object
- #post_error(timestamp_s) ⇒ Object
- #post_link_execute(arg_hash) ⇒ Object
- #post_mock_generate(arg_hash) ⇒ Object
- #post_mock_preprocess(arg_hash) ⇒ Object
- #post_release_build(timestamp_s) ⇒ Object
- #post_runner_generate(arg_hash) ⇒ Object
- #post_test(test) ⇒ Object
- #post_test_build(context, timestamp_s) ⇒ Object
- #post_test_fixture_execute(arg_hash) ⇒ Object
- #post_test_preprocess(arg_hash) ⇒ Object
- #pre_build(timestamp_s) ⇒ Object
- #pre_compile_execute(arg_hash) ⇒ Object
- #pre_link_execute(arg_hash) ⇒ Object
- #pre_mock_generate(arg_hash) ⇒ Object
-
#pre_mock_preprocess(arg_hash) ⇒ Object
execute all plugin methods ####.
- #pre_release_build(timestamp_s) ⇒ Object
- #pre_runner_generate(arg_hash) ⇒ Object
- #pre_test(test) ⇒ Object
- #pre_test_build(context, timestamp_s) ⇒ Object
- #pre_test_fixture_execute(arg_hash) ⇒ Object
- #pre_test_preprocess(arg_hash) ⇒ Object
- #print_plugin_failures ⇒ Object
- #register_build_failure(context, message) ⇒ Object
- #setup ⇒ Object
- #summary ⇒ Object
Instance Method Details
#load_programmatic_plugins(plugins, system_objects) {|{ :environment => environment }| ... } ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 19 def load_programmatic_plugins(plugins, system_objects) environment = [] plugins.each do |hash| # Protect against instantiating object multiple times due to processing config multiple times (option files, etc) next if (@plugin_manager_helper.include?( @plugin_objects, hash[:plugin] ) ) @loginator.lazy( Verbosity::OBNOXIOUS ) do @reportinator.generate_progress( "Instantiating plugin class #{camelize( hash[:plugin] )}" ) end begin @system_wrapper.require_file( "#{hash[:plugin]}.rb" ) object = @plugin_manager_helper.instantiate_plugin( camelize( hash[:plugin] ), system_objects, hash[:plugin], hash[:root_path] ) @plugin_objects << object environment += object.environment # Add plugins to hash of all system objects system_objects[hash[:plugin].downcase().to_sym()] = object rescue @loginator.log( "Exception raised while trying to load plugin: #{hash[:plugin]}", Verbosity::ERRORS, LogLabels::EXCEPTION ) raise # Raise again for backtrace, etc. end end yield( { :environment => environment } ) if (environment.size > 0) end |
#plugins_failed? ⇒ Boolean
52 53 54 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 52 def plugins_failed? return (@build_fail_registry.size > 0) end |
#post_build(timestamp_s) ⇒ Object
132 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 132 def post_build(); execute_plugins(:post_build, ); end |
#post_compile_execute(arg_hash) ⇒ Object
106 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 106 def post_compile_execute(arg_hash); execute_plugins(:post_compile_execute, arg_hash); end |
#post_error(timestamp_s) ⇒ Object
133 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 133 def post_error(); execute_plugins(:post_error, ); end |
#post_link_execute(arg_hash) ⇒ Object
109 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 109 def post_link_execute(arg_hash); execute_plugins(:post_link_execute, arg_hash); end |
#post_mock_generate(arg_hash) ⇒ Object
100 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 100 def post_mock_generate(arg_hash); execute_plugins(:post_mock_generate, arg_hash); end |
#post_mock_preprocess(arg_hash) ⇒ Object
94 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 94 def post_mock_preprocess(arg_hash); execute_plugins(:post_mock_preprocess, arg_hash); end |
#post_release_build(timestamp_s) ⇒ Object
129 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 129 def post_release_build(); execute_plugins(:post_release_build, ); end |
#post_runner_generate(arg_hash) ⇒ Object
103 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 103 def post_runner_generate(arg_hash); execute_plugins(:post_runner_generate, arg_hash); end |
#post_test(test) ⇒ Object
123 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 123 def post_test(test); execute_plugins(:post_test, test); end |
#post_test_build(context, timestamp_s) ⇒ Object
126 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 126 def post_test_build(context, ); execute_plugins(:post_test_build, context, ); end |
#post_test_fixture_execute(arg_hash) ⇒ Object
112 113 114 115 116 117 118 119 120 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 112 def post_test_fixture_execute(arg_hash) # Special arbitration: Raw test results are printed or taken over by plugins handling the job @loginator.log( arg_hash[:shell_result][:output] ) if @configurator.plugins_display_raw_test_results # Core failure detection independent of any reporting plugin register_build_failure( arg_hash[:context], 'Unit test failures' ) if arg_hash.dig(:results, :counts, :failed).to_i > 0 execute_plugins(:post_test_fixture_execute, arg_hash) end |
#post_test_preprocess(arg_hash) ⇒ Object
97 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 97 def post_test_preprocess(arg_hash); execute_plugins(:post_test_preprocess, arg_hash); end |
#pre_build(timestamp_s) ⇒ Object
131 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 131 def pre_build(); execute_plugins(:pre_build, ); end |
#pre_compile_execute(arg_hash) ⇒ Object
105 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 105 def pre_compile_execute(arg_hash); execute_plugins(:pre_compile_execute, arg_hash); end |
#pre_link_execute(arg_hash) ⇒ Object
108 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 108 def pre_link_execute(arg_hash); execute_plugins(:pre_link_execute, arg_hash); end |
#pre_mock_generate(arg_hash) ⇒ Object
99 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 99 def pre_mock_generate(arg_hash); execute_plugins(:pre_mock_generate, arg_hash); end |
#pre_mock_preprocess(arg_hash) ⇒ Object
execute all plugin methods ####
93 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 93 def pre_mock_preprocess(arg_hash); execute_plugins(:pre_mock_preprocess, arg_hash); end |
#pre_release_build(timestamp_s) ⇒ Object
128 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 128 def pre_release_build(); execute_plugins(:pre_release_build, ); end |
#pre_runner_generate(arg_hash) ⇒ Object
102 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 102 def pre_runner_generate(arg_hash); execute_plugins(:pre_runner_generate, arg_hash); end |
#pre_test(test) ⇒ Object
122 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 122 def pre_test(test); execute_plugins(:pre_test, test); end |
#pre_test_build(context, timestamp_s) ⇒ Object
125 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 125 def pre_test_build(context, ); execute_plugins(:pre_test_build, context, ); end |
#pre_test_fixture_execute(arg_hash) ⇒ Object
111 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 111 def pre_test_fixture_execute(arg_hash); execute_plugins(:pre_test_fixture_execute, arg_hash); end |
#pre_test_preprocess(arg_hash) ⇒ Object
96 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 96 def pre_test_preprocess(arg_hash); execute_plugins(:pre_test_preprocess, arg_hash); end |
#print_plugin_failures ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 56 def print_plugin_failures return if (@build_fail_registry.size == 0) failures = [] = @reportinator.( @loginator.decorate( 'BUILD FAILURE SUMMARY', LogLabels::FAIL ) ) # If we only ran basic unit tests, there's no need to prefix the failure messages with the context. if (@build_fail_registry.keys.size == 1 and @build_fail_registry.keys[0] == TEST_SYM) @build_fail_registry.each do |context, | .each {|| failures << } end # Otherwise, add the context to each message so the user knows the source of the failure. else @build_fail_registry.each do |context, | .each {|| failures << "[#{context.to_s.upcase}] #{}"} end end @loginator.log_list( failures, "\n" + , Verbosity::ERRORS, LogLabels::NONE ) end |
#register_build_failure(context, message) ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 79 def register_build_failure(context, ) return if (.nil? or .empty?) _context = context.is_a?(Symbol) ? context : context.to_sym # Create a new key/value with empty list if it doesn't exist @build_fail_registry[_context] ||= [] list = @build_fail_registry[_context] list << if !list.include?( ) end |
#setup ⇒ Object
14 15 16 17 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 14 def setup @build_fail_registry = {} @plugin_objects = [] # List so we can preserve order end |
#summary ⇒ Object
135 |
# File 'lib/ceedling/plugins/plugin_manager.rb', line 135 def summary; execute_plugins(:summary); end |