From 0293aa95a8432a9d4c9a5253447b3bd2cbdec715 Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Wed, 15 Jan 2025 15:36:54 -0500 Subject: [PATCH] Finish replacing arguments where needed. --- lib/ceedling/include_pathinator.rb | 4 ++-- lib/ceedling/preprocessinator_extractor.rb | 6 +++--- lib/ceedling/test_invoker_helper.rb | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/ceedling/include_pathinator.rb b/lib/ceedling/include_pathinator.rb index dbd6972f..f32344d9 100644 --- a/lib/ceedling/include_pathinator.rb +++ b/lib/ceedling/include_pathinator.rb @@ -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 @@ -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 diff --git a/lib/ceedling/preprocessinator_extractor.rb b/lib/ceedling/preprocessinator_extractor.rb index 72d4458e..d2d6fa2b 100644 --- a/lib/ceedling/preprocessinator_extractor.rb +++ b/lib/ceedling/preprocessinator_extractor.rb @@ -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 diff --git a/lib/ceedling/test_invoker_helper.rb b/lib/ceedling/test_invoker_helper.rb index 4a299844..56e7bba0 100644 --- a/lib/ceedling/test_invoker_helper.rb +++ b/lib/ceedling/test_invoker_helper.rb @@ -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 @@ -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"