- add ceedling/cmock/unity as testing framework and support
- unified makefile project for the whole repos - new separate project for tests
This commit is contained in:
21
tests/vendor/ceedling/lib/preprocessinator_file_handler.rb
vendored
Normal file
21
tests/vendor/ceedling/lib/preprocessinator_file_handler.rb
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
|
||||
class PreprocessinatorFileHandler
|
||||
|
||||
constructor :preprocessinator_extractor, :configurator, :tool_executor, :file_path_utils, :file_wrapper
|
||||
|
||||
|
||||
def preprocess_file(filepath, includes)
|
||||
preprocessed_filepath = @file_path_utils.form_preprocessed_file_filepath(filepath)
|
||||
|
||||
command = @tool_executor.build_command_line(@configurator.tools_test_file_preprocessor, filepath, preprocessed_filepath)
|
||||
@tool_executor.exec(command[:line], command[:options])
|
||||
|
||||
contents = @preprocessinator_extractor.extract_base_file_from_preprocessed_expansion(preprocessed_filepath)
|
||||
|
||||
includes.each{|include| contents.unshift("#include \"#{include}\"")}
|
||||
|
||||
@file_wrapper.write(preprocessed_filepath, contents.join("\n"))
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user