mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-08-06 13:50:49 +08:00
Added ability to inject defines, much like what was built into Ceedling before Ceedling switched to just using this generator.
This commit is contained in:
@ -23,6 +23,7 @@ class UnityTestRunnerGenerator
|
|||||||
def self.default_options
|
def self.default_options
|
||||||
{
|
{
|
||||||
:includes => [],
|
:includes => [],
|
||||||
|
:defines => [],
|
||||||
:plugins => [],
|
:plugins => [],
|
||||||
:framework => :unity,
|
:framework => :unity,
|
||||||
:test_prefix => "test|spec|should",
|
:test_prefix => "test|spec|should",
|
||||||
@ -167,6 +168,9 @@ class UnityTestRunnerGenerator
|
|||||||
output.puts('#include <setjmp.h>')
|
output.puts('#include <setjmp.h>')
|
||||||
output.puts('#include <stdio.h>')
|
output.puts('#include <stdio.h>')
|
||||||
output.puts('#include "CException.h"') if @options[:plugins].include?(:cexception)
|
output.puts('#include "CException.h"') if @options[:plugins].include?(:cexception)
|
||||||
|
if (@options[:defines] && !@options[:defines].empty?)
|
||||||
|
@options[:defines].each {|d| output.puts("#define #{d}")}
|
||||||
|
end
|
||||||
if (@options[:header_file] && !@options[:header_file].empty?)
|
if (@options[:header_file] && !@options[:header_file].empty?)
|
||||||
output.puts("#include \"#{File.basename(@options[:header_file])}\"")
|
output.puts("#include \"#{File.basename(@options[:header_file])}\"")
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user