mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-06-06 05:25:29 +00:00
automatically pull in unity helper into tests when specified in both example and cmock's includes.
This commit is contained in:
@@ -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/)
|
||||
|
||||
@@ -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,2 +1,2 @@
|
||||
2.4.6
|
||||
2.4.7
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user