mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-10-01 22:47:25 +00:00
Add treat_inline configuration option
This commit is contained in:
@@ -29,6 +29,7 @@ class CMockConfig
|
|||||||
:when_ptr => :compare_data, #the options being :compare_ptr, :compare_data, or :smart
|
:when_ptr => :compare_data, #the options being :compare_ptr, :compare_data, or :smart
|
||||||
:verbosity => 2, #the options being 0 errors only, 1 warnings and errors, 2 normal info, 3 verbose
|
:verbosity => 2, #the options being 0 errors only, 1 warnings and errors, 2 normal info, 3 verbose
|
||||||
:treat_externs => :exclude, #the options being :include or :exclude
|
:treat_externs => :exclude, #the options being :include or :exclude
|
||||||
|
:treat_inline => :exclude, #the options being :include or :exclude
|
||||||
:callback_include_count => true,
|
:callback_include_count => true,
|
||||||
:callback_after_arg_check => false,
|
:callback_after_arg_check => false,
|
||||||
:includes => nil,
|
:includes => nil,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
class CMockHeaderParser
|
class CMockHeaderParser
|
||||||
|
|
||||||
attr_accessor :funcs, :c_attr_noconst, :c_attributes, :treat_as_void, :treat_externs
|
attr_accessor :funcs, :c_attr_noconst, :c_attributes, :treat_as_void, :treat_externs, :treat_inline
|
||||||
|
|
||||||
def initialize(cfg)
|
def initialize(cfg)
|
||||||
@funcs = []
|
@funcs = []
|
||||||
@@ -24,7 +24,9 @@ class CMockHeaderParser
|
|||||||
@local_as_void = @treat_as_void
|
@local_as_void = @treat_as_void
|
||||||
@verbosity = cfg.verbosity
|
@verbosity = cfg.verbosity
|
||||||
@treat_externs = cfg.treat_externs
|
@treat_externs = cfg.treat_externs
|
||||||
|
@treat_inline = cfg.treat_inline
|
||||||
@c_strippables += ['extern'] if (@treat_externs == :include) #we'll need to remove the attribute if we're allowing externs
|
@c_strippables += ['extern'] if (@treat_externs == :include) #we'll need to remove the attribute if we're allowing externs
|
||||||
|
@c_strippables += ['inline'] if (@treat_inline == :include) #we'll need to remove the attribute if we're allowing externs
|
||||||
end
|
end
|
||||||
|
|
||||||
def parse(name, source)
|
def parse(name, source)
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ describe CMockHeaderParser, "Verify CMockHeaderParser Module" do
|
|||||||
@config.expect :when_no_prototypes, :error
|
@config.expect :when_no_prototypes, :error
|
||||||
@config.expect :verbosity, 1
|
@config.expect :verbosity, 1
|
||||||
@config.expect :treat_externs, :exclude
|
@config.expect :treat_externs, :exclude
|
||||||
|
@config.expect :treat_inline, :exclude
|
||||||
@config.expect :array_size_type, ['int', 'size_t']
|
@config.expect :array_size_type, ['int', 'size_t']
|
||||||
@config.expect :array_size_name, 'size|len'
|
@config.expect :array_size_name, 'size|len'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user