Skip to content

Commit

Permalink
Finish replacing arguments where needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
mvandervoord committed Jan 15, 2025
1 parent 912ee94 commit 0293aa9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/ceedling/include_pathinator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def validate_test_build_directive_paths
# TODO: When Ceedling's base project path handling is resolved, enable this path redefinition
# path = File.join( @base_path, path )
unless @file_wrapper.exist?(path)
error = "'#{path}' specified by #{UNITY_TEST_INCLUDE_PATH}() within #{test_filepath} not found"
error = "'#{path}' specified by TEST_INCLUDE_PATH() within #{test_filepath} not found"
raise CeedlingException.new( error )
end
end
Expand All @@ -51,7 +51,7 @@ def validate_header_files_collection

if headers.length == 0
error = "No header files found in project.\n" +
"Add search paths to :paths ↳ :include in your project file and/or use #{UNITY_TEST_INCLUDE_PATH}() in your test files.\n" +
"Add search paths to :paths ↳ :include in your project file and/or use TEST_INCLUDE_PATH() in your test files.\n" +
"Verify header files with `ceedling paths:include` and\\or `ceedling files:include`."
@loginator.log( error, Verbosity::COMPLAIN )
end
Expand Down
6 changes: 3 additions & 3 deletions lib/ceedling/preprocessinator_extractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ def extract_test_directive_macro_calls(file_contents)
# Look for TEST_SOURCE_FILE("...") and TEST_INCLUDE_PATH("...") in a string (i.e. a file's contents as a string)

regexes = [
/TEST_SOURCE_FILE\(\s*\"\s*[^"]+\s*\"\s*\)/,
/TEST_INCLUDE_PATH\(\s*\"\s*[^"]+\s*\"\s*\)/
/(#{PATTERNS::TEST_SOURCE_FILE})/,
/(#{PATTERNS::TEST_INCLUDE_PATH})/
]

return extract_tokens_by_regex_list( file_contents, *regexes )
return extract_tokens_by_regex_list( file_contents, *regexes ).map(&:first)
end


Expand Down
6 changes: 3 additions & 3 deletions lib/ceedling/test_invoker_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ def validate_build_directive_source_files(test:, filepath:)
end

if not valid_extension
error = "File '#{source}' specified with #{UNITY_TEST_SOURCE_FILE}() in #{test} is not a #{ext_message} source file"
error = "File '#{source}' specified with TEST_SOURCE_FILE() in #{test} is not a #{ext_message} source file"
raise CeedlingException.new(error)
end

if @file_finder.find_build_input_file(filepath: source, complain: :ignore, context: TEST_SYM).nil?
error = "File '#{source}' specified with #{UNITY_TEST_SOURCE_FILE}() in #{test} cannot be found in the source file collection"
error = "File '#{source}' specified with TEST_SOURCE_FILE() in #{test} cannot be found in the source file collection"
raise CeedlingException.new(error)
end
end
Expand Down Expand Up @@ -321,7 +321,7 @@ def generate_executable_now(context:, build_path:, executable:, objects:, flags:
notice += "OPTIONS:\n" +
" 1. Doublecheck this test's #include statements.\n" +
" 2. Simplify complex macros or fully specify symbols for this test in :project ↳ :defines.\n" +
" 3. If no header file corresponds to the needed source file, use the #{UNITY_TEST_SOURCE_FILE}()\n" +
" 3. If no header file corresponds to the needed source file, use the TEST_SOURCE_FILE()\n" +
" build diective macro in this test to inject a source file into the build.\n\n" +
"See the docs on conventions, paths, preprocessing, compilation symbols, and build directive macros.\n\n"

Expand Down

0 comments on commit 0293aa9

Please sign in to comment.