diff --git a/lib/ceedling/test_invoker.rb b/lib/ceedling/test_invoker.rb index 63a29d4a..7dd7490b 100644 --- a/lib/ceedling/test_invoker.rb +++ b/lib/ceedling/test_invoker.rb @@ -305,7 +305,7 @@ def setup_and_invoke(tests:, context:TEST_SYM, options:{}) end # CMock + Unity + CException - test_frameworks = @helper.collect_test_framework_sources + test_frameworks = @helper.collect_test_framework_sources( details[:mock_list] ) # Extra suport source files (e.g. microcontroller startup code needed by simulator) test_support = @configurator.collection_all_support diff --git a/lib/ceedling/test_invoker_helper.rb b/lib/ceedling/test_invoker_helper.rb index 395de3ff..051eeba5 100644 --- a/lib/ceedling/test_invoker_helper.rb +++ b/lib/ceedling/test_invoker_helper.rb @@ -167,18 +167,18 @@ def flags(context:, operation:, filepath:) return @flaginator.flag_down( context:context, operation:operation, filepath:filepath ) end - def collect_test_framework_sources + def collect_test_framework_sources(mocks) sources = [] sources << File.join(PROJECT_BUILD_VENDOR_UNITY_PATH, UNITY_C_FILE) - sources << File.join(PROJECT_BUILD_VENDOR_CMOCK_PATH, CMOCK_C_FILE) if @configurator.project_use_mocks + sources << File.join(PROJECT_BUILD_VENDOR_CMOCK_PATH, CMOCK_C_FILE) if @configurator.project_use_mocks and !mocks.empty? sources << File.join(PROJECT_BUILD_VENDOR_CEXCEPTION_PATH, CEXCEPTION_C_FILE) if @configurator.project_use_exceptions # If we're (a) using mocks (b) a Unity helper is defined and (c) that unity helper includes a source file component, # then link in the unity_helper object file too. if @configurator.project_use_mocks @configurator.cmock_unity_helper_path.each do |helper| - if @file_wrapper.exist?( helper.ext(EXTENSION_SOURCE) ) + if @file_wrapper.exist?( helper.ext( EXTENSION_SOURCE ) ) sources << helper end end