mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-08-07 03:37:50 +00:00
Added option to remove setjmp.h from generated mock files as not supported on all embedded systems
This commit is contained in:
@@ -41,6 +41,7 @@ class CMockConfig
|
||||
:array_size_type => [],
|
||||
:array_size_name => 'size|len',
|
||||
:skeleton => false,
|
||||
:has_setjmp_h => true,
|
||||
|
||||
# Format to look for inline functions.
|
||||
# This is a combination of "static" and "inline" keywords ("static inline", "inline static", "inline", "static")
|
||||
|
||||
@@ -19,6 +19,7 @@ class CMockGenerator
|
||||
@ordered = @config.enforce_strict_ordering
|
||||
@framework = @config.framework.to_s
|
||||
@fail_on_unexpected_calls = @config.fail_on_unexpected_calls
|
||||
@has_setjmp_h = @config.has_setjmp_h
|
||||
|
||||
@subdir = @config.subdir
|
||||
|
||||
@@ -169,7 +170,9 @@ class CMockGenerator
|
||||
file << "/* AUTOGENERATED FILE. DO NOT EDIT. */\n" unless functions.empty?
|
||||
file << "#include <string.h>\n"
|
||||
file << "#include <stdlib.h>\n"
|
||||
file << "#include <setjmp.h>\n"
|
||||
if @has_setjmp_h
|
||||
file << "#include <setjmp.h>\n"
|
||||
end
|
||||
file << "#include \"cmock.h\"\n"
|
||||
@includes_c_pre_header.each { |inc| file << "#include #{inc}\n" }
|
||||
file << "#include \"#{header_file}\"\n"
|
||||
@@ -205,7 +208,9 @@ class CMockGenerator
|
||||
end
|
||||
|
||||
def create_extern_declarations(file)
|
||||
file << "extern jmp_buf AbortFrame;\n"
|
||||
if @has_setjmp_h
|
||||
file << "extern jmp_buf AbortFrame;\n"
|
||||
end
|
||||
if @ordered
|
||||
file << "extern int GlobalExpectCount;\n"
|
||||
file << "extern int GlobalVerifyOrder;\n"
|
||||
|
||||
Reference in New Issue
Block a user