From a4a2eb787d80e58999614e0401a3bf02233ce342 Mon Sep 17 00:00:00 2001 From: Greg Williams Date: Wed, 30 Jul 2014 10:28:24 -0400 Subject: [PATCH] Added more robust handling of test includes, and to provide backwards API compatibility for Ceedling --- auto/generate_test_runner.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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|