Sha256: b10c27fff9f9fd3538ea01bd6ab5bdc34107f00c36c04031bc0ee4a44335ca31

Contents?: true

Size: 1.58 KB

Versions: 14

Compression:

Stored size: 1.58 KB

Contents


class PreprocessinatorHelper
  
  constructor :configurator, :test_includes_extractor, :task_invoker, :file_finder, :file_path_utils


  def preprocess_includes(test, preprocess_includes_proc)
    if (@configurator.project_use_test_preprocessor)
      preprocessed_includes_list = @file_path_utils.form_preprocessed_includes_list_filepath(test)
      preprocess_includes_proc.call( @file_finder.find_test_from_file_path(preprocessed_includes_list) )
      @test_includes_extractor.parse_includes_list(preprocessed_includes_list)
    else
      @test_includes_extractor.parse_test_file(test)      
    end  
  end

  def assemble_mocks_list(test)
    return @file_path_utils.form_mocks_source_filelist( @test_includes_extractor.lookup_raw_mock_list(test) )
  end

  def preprocess_mockable_headers(mock_list, preprocess_file_proc)
    if (@configurator.project_use_test_preprocessor)
      preprocess_files_smartly(
        @file_path_utils.form_preprocessed_mockable_headers_filelist(mock_list),
        preprocess_file_proc ) { |file| @file_finder.find_header_file(file) }
    end
  end

  def preprocess_test_file(test, preprocess_file_proc)
    return if (!@configurator.project_use_test_preprocessor)
    
    preprocess_file_proc.call(test)
  end
  
  private ############################

  def preprocess_files_smartly(file_list, preprocess_file_proc)
    if (@configurator.project_use_deep_dependencies)
      @task_invoker.invoke_test_preprocessed_files(file_list)
    else
      file_list.each { |file| preprocess_file_proc.call( yield(file) ) }
    end
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ceedling-0.13.0 lib/preprocessinator_helper.rb
ceedling-0.13.0.rc1 lib/preprocessinator_helper.rb
ceedling-0.12.2 new_project_template/vendor/ceedling/lib/preprocessinator_helper.rb
ceedling-0.12.1 new_project_template/vendor/ceedling/lib/preprocessinator_helper.rb
ceedling-0.12.0 new_project_template/vendor/ceedling/lib/preprocessinator_helper.rb
ceedling-0.11.2 new_project_template/vendor/ceedling/lib/preprocessinator_helper.rb
ceedling-0.11.1 new_project_template/vendor/ceedling/lib/preprocessinator_helper.rb
ceedling-0.11.0 new_project_template/vendor/ceedling/lib/preprocessinator_helper.rb
ceedling-0.10.0 new_project_template/vendor/ceedling/lib/preprocessinator_helper.rb
ceedling-0.9.4 new_project_template/vendor/ceedling/lib/preprocessinator_helper.rb
ceedling-0.9.2 new_project_template/vendor/ceedling/lib/preprocessinator_helper.rb
ceedling-0.9.0 new_project_template/vendor/ceedling/lib/preprocessinator_helper.rb
ceedling-0.0.18 new_project_template/vendor/ceedling/lib/preprocessinator_helper.rb
ceedling-0.0.17 new_project_template/vendor/ceedling/lib/preprocessinator_helper.rb