automatically pull in unity helper into tests when specified in both example and cmock's includes.

This commit is contained in:
Mark VanderVoord
2019-07-09 10:50:29 -04:00
parent 0b6118e410
commit 7761b3fb3f
6 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -185,8 +185,8 @@ module RakefileHelpers
obj_list = []
# Detect dependencies and build required required modules
header_list = extract_headers(test) + ['cmock.h']
header_list.each do |header|
header_list = extract_headers(test) + ['cmock.h'] + [ cfg[:cmock][:unity_helper_path] ]
header_list.compact.uniq.each do |header|
#create mocks if needed
if (header =~ /Mock/)
+1
View File
@@ -64,6 +64,7 @@ class CMockConfig
end
options[:unity_helper_path] ||= options[:unity_helper]
options[:unity_helper_path] = [options[:unity_helper_path]] if options[:unity_helper_path].is_a? String
options[:includes_c_post_header] = ((options[:includes_c_post_header] || []) + (options[:unity_gelper_path] || [])).uniq
options[:plugins].compact!
options[:plugins].map! {|p| p.to_sym}
@options = options
+1 -1
View File
@@ -1,2 +1,2 @@
2.4.6
2.4.7
+1
View File
@@ -50,6 +50,7 @@ module RakefileHelpers
includes << m[1]
end
end
includes << File.basename(filename,".c").slice(5,256) + "_unity_helper.h"
return includes
end
-1
View File
@@ -104,7 +104,6 @@ class SystemTestGenerator
return if tests.nil?
includes = [UNITY_H, CMOCK_H]
includes << (namix + UNITY_HELPER_H) if not yaml_hash[:systest][:unity_helper].nil?
includes << [MOCK_PREFIX + namix + MOCKABLE_H]
includes << [name + H_EXTENSION]
@@ -3,6 +3,7 @@
:plugins:
- # none
:memcmp_if_unknown: false
:unity_helper_path: expect_and_return_custom_types_unity_helper.h
:systest:
:types: |
@@ -35,7 +36,6 @@
:tests:
:common: |
#include "expect_and_return_custom_types_unity_helper.h"
void setUp(void) {}
void tearDown(void) {}