tests/vendor/ceedling/lib/preprocessinator_includes_handler.rb
# ask the preprocessor for a make-style dependency rule of only the headers the source file immediately includes
ask the preprocessor for a make-style dependency rule of only the headers the source file immediately includes
ask the preprocessor for a make - style dependency rule of only the headers the source file immediately includes
def form_shallow_dependencies_rule(filepath)
    temp_filepath = @file_path_utils.form_temp_path(filepath, '_')
    contents = @file_wrapper.read(filepath)
    contents.gsub!( /#include\s+\"\s*(\S+)\s*\"/, "#include \"\\1\"\n#include \"@@@@\\1\"" )
    @file_wrapper.write( temp_filepath, contents )
    command = @tool_executor.build_command_line(@configurator.tools_test_includes_preprocessor, temp_filepath)
    shell_result = @tool_executor.exec(command[:line], command[:options])
    return shell_result[:output]
  end
def form_shallow_dependencies_rule ( filepath ) temp_filepath = @file_path_utils . form_temp_path ( filepath , '_' ) contents = @file_wrapper . read ( filepath ) contents . gsub! ( / #include \s + \" \s *( \S +) \s * \" / , "#include \"\\1\"\n#include \"@@@@\\1\"" ) @file_wrapper . write ( temp_filepath , contents ) command = @tool_executor . build_command_line ( @configurator . tools_test_includes_preprocessor , temp_filepath ) shell_result = @tool_executor . exec ( command [ :line ] , command [ :options ] ) return shell_result [ :output ] end
ask the preprocessor for a make-style dependency rule of only the headers the source file immediately includes
ask the preprocessor for a make - style dependency rule of only the headers the source file immediately includes
# change filename (prefix of '_') to prevent preprocessor from finding include files in temp directory containing file it's scanning # read the file and replace all include statements with a decorated version # (decorating the names creates file names that don't exist, thus preventing the preprocessor  #  from snaking out and discovering the entire include path that winds through the code) # extract the make-style dependency rule telling the preprocessor to  #  ignore the fact that it can't find the included files
filepath