diff --git a/auto/generate_test_runner.rb b/auto/generate_test_runner.rb index f78faee..a61529b 100644 --- a/auto/generate_test_runner.rb +++ b/auto/generate_test_runner.rb @@ -130,7 +130,7 @@ class UnityTestRunnerGenerator return mock_headers end - def create_header(output, mocks, testfile_includes) + def create_header(output, mocks, testfile_includes=[]) output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */') create_runtest(output, mocks) output.puts("\n//=======Automagically Detected Files To Include=====") @@ -142,9 +142,9 @@ class UnityTestRunnerGenerator output.puts('#include ') output.puts('#include ') output.puts('#include "CException.h"') if @options[:plugins].include?(:cexception) - testfile_includes.delete("unity").delete("cmock") - testrunner_includes = testfile_includes - mocks - testrunner_includes.each do |inc| + testfile_includes.delete_if{|inc| inc =~ /(unity|cmock)/} + testrunner_includes = testfile_includes - mocks + testrunner_includes.each do |inc| output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h','')}.h\""}") end mocks.each do |mock|